<!DOCTYPE html>
<!-- saved from url=(0040)https://browserext.github.io/browserext/ -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Browser Extensions</title>
    
    <style>
        table, td, th {
            border: 1px solid black;
            padding: 8px;
            font-size: 11pt;
            vertical-align: text-top;
        }
        
        table {
            border-collapse: collapse;
        }
    </style>
    <script src="https://www.w3.org/Tools/respec/respec-w3c-common" async="" class="remove"></script>
    <script class="remove">
      var respecConfig = {
	shortName: "browserext",
	edDraftURI:"https://browserext.github.io/browserext/",

	specStatus: "CG-DRAFT",
	editors: [
	  {
	    name: "Mike Pietraszak",
	    company:"Microsoft Corporation"
	  }
	],

	wg: "Browser Extension Community Group",
	wgURI: "https://www.w3.org/community/browserext/",

	otherLinks: [{
	  key: 'Participation',
	  data: [
	    {
	      value: 'GitHub repository',
	      href: 'https://github.com/browserext/browserext/'
	    },
	    {
	      value: 'File a bug / view open issues',
	      href: 'https://github.com/browserext/browserext/issues'
	    }
	  ]
	}],
      };
    </script>
</head>
<body>
    <section id="abstract">
        <p>
            Modern browsers can add new functionality to sites and the browser itself through
            script-based extensions. This document specifies an API set that allows developers
            to create interoperable extensions for browsers that support the API set,
            as well as the packaging format to be used for such extensions.
        </p>
    </section>
    <section id="sotd">
        <p>
            If you wish to make comments regarding this document, please file issues on
            <a href="https://github.com/browserext/browserext/issues/">github</a>.
            A <a href="mailto:public-browserext@w3.org">public mailing list</a>
            (<a href="mailto:public-browserext-request@w3.org?subject=subscribe">subscribe</a>,
            <a href="http://lists.w3.org/Archives/Public/public-browserext/">archives</a>)
            is also available,
            but is reserved for high level discussions,
            and is not appropriate for specific comments about this document.
        </p>
        <p>
            Work on this document is governed by
            <a href="http://browserext.github.io/charter/">the charter</a> of the Browser Extension CG,
            which includes among other things the <a href="http://browserext.github.io/charter/#communication">Communication</a>,
            <a href="http://browserext.github.io/charter/#decision-policy">Decision</a>,
            and <a href="http://browserext.github.io/charter/#contribution-mechanics">Contribution</a> policies
            of this community group.
        </p>

	<div class="warning" id="inactive-cg">
		<p>Implementation of the technologies discussed and specified in this Community Group is ongoing
		and none of the original contributors have expressed opposition
		to this work.
		However, due to various circumstances,
		the level of participation has drooped below the level
		at which productive discussion is possible,
		and this group has become dormant as a result.
		</p>

		<p>The specifications have therefore not been maintained in a while,
		and are likely to be out of date.
		Issues can be raised and comments can be added to existing ones,
		but timely responses are unlikely at best.
		</p>

		<p>People interested in this work being resumed are encouraged
		to drum up support among the various implementors.
		</p>
	</div>

    </section>

    <section class="informative">
        <h2>Introduction</h2>
        <p>
            Because browsers supported different add-on models, extension authors wound up creating divergent codebases and delivering different browser-specific add-ons. This Community Group's goal is to make browser extension code much more interoperable across browsers by specifying common extension interfaces and well-defined browser behavior. This will allow extension authors to greatly reduce or eliminate the rework necessary to create extensions that target different browsers.
        </p>
    </section>

    <section class="informative">
        <h2>Core APIs</h2>
        <p>
            The goal for these core APIs is to provide functionality that extension authors need for: 
        </p>
        <ul>
            <li>page modification for web site content</li>
            <li>UI augmentation for web browsers (host apps)</li>
            <li>network request modification</li>
            <li>passing data between extensions</li>
            <li>passing data from Internet-hosted web pages to extensions</li>
            <li>accessing user settings such as cookies</li>
        </ul>
        <p class="issue">Need to resolve ID issue before we can address messaging ('passing data')<br>GitHub Issues <a href="https://github.com/browserext/browserext/issues/14">14</a>&nbsp;&amp;&nbsp;<a href="https://github.com/browserext/browserext/issues/17">17</a></p>
        <section>
            <h3 id="apiavailability">API Availability</h3>
            <section class="informative">
                <h3>Overview</h3>
                <p>
                    Browser extensions are authored primarily with JavaScript. In addition to the usual <a href="https://www.w3.org/standards/webdesign/script">JavaScript Web APIs</a>, additional APIs are available exclusively to extensions via the <code>browser</code> object. However, the specific APIs that are available to an extension from the <code>browser</code> object are dependent upon:
                </p>
                <ul>
                    <li>Execution context (e.g. background/event, popup, options, content, extension page)
                    </li><li>Keys declared in the manifest (e.g. browser_action, page_action)
                    </li><li>Permissions declared in the manifest (e.g. contextMenu, tabs, webNavigation, webRequest)
                    </li><li>Content Security Policy (CSP) for the extension and target web page (for content scripts)
                </li></ul>
                </section>

                <section class="informative">
                    <h4>Execution Context and Manifest Restrictions</h4>
                    <p>
                        Browser extension pages and their corresponding scripts are executed in one of the following contexts. The manifest declarations required to create each specific type of page are described below.
                    </p>
                    <ul>
                        <li>
                            <b>Browser extension contexts ("Window")</b> - Most extension APIs are available to this context
                            <ul>
                                <li><b>Background page</b> - use the "background" manifest key and specify "persistent" true </li>
                                <li><b>Event page</b> - use the "background" manifest key and specify "persistent" false </li>
                                <li><b>Popup page</b> - use the "browser_action" or "page_action" manifest key and specify "default_popup" </li>
                                <li><b>Options page</b> - use the "options_page" manifest key </li>
                                <li><b>Custom page</b> - such as "browserext://&lt;ext_id&gt;/myCustomPage.html" </li>
                            </ul>
                        </li>
                        <li><b>Content script context</b> - A limited number of APIs are available to script that extensions use to interact with hosted web site pages
                        </li><li><b>Internet-hosted web page context</b> - Messaging APIs can be used to send messages from hosted web site pages such as https://en.wikipedia.org/wiki/Main_Page/index.html or https://w3c.github.io/html/index.html to extensions
                    </li></ul>

                    <section>
                        <h5 id="availability-manifest">Table: API Availability Summary</h5>
                        <p>
                            Some browser extension API require a specific manifest key or specific permission. If the key or permission are not declared or not granted, the object will not be available for scripting. These requirements are summarized in the table below. If manifest keys that are not defined in this specification are specified, other browsers MAY elect to ignore those additional keys.
                        </p>
                        <table>
                            <tbody><tr>
                                <th rowspan="2">API object</th>
                                <th colspan="3">Execution Context</th>
                                <th colspan="1">Required Declaration</th>
                            </tr>
                            <tr>
                                <th>Background page,Event page,Popup page,Options page,Custom page</th>
                                <th>Content script page</th>
                                <th>Internet-hosted web page</th>
                                <th>Manifest key</th>
                            </tr>
                            <tr>
                                <th><code>browserAction</code></th>
                                <td>Y<sup><a href="https://browserext.github.io/browserext/#note1">1</a></sup></td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td>"browser_action"<sup><a href="https://browserext.github.io/browserext/#note1">1</a></sup></td>
                            </tr>
                            <tr>
                                <th><code>contextMenus</code></th>
                                <td>Y</td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td>"permissions":["context_menus"]</td>
                            </tr>
                            <tr>
                                <th><code>extension</code></th>
                                <td>Y</td>
                                <td>Y</td>
                                <td><p></p></td>
                                <td><p></p></td>
                            </tr>
                            <tr>
                                <th><code>i18n</code></th>
                                <td>Y</td>
                                <td>Y</td>
                                <td><p></p></td>
                                <td>"default_lang" : "&lt;lang&gt;"<sup><a href="https://browserext.github.io/browserext/#note4">4</a></sup></td>
                            </tr>
                            <tr>
                                <th><code>pageAction</code></th>
                                <td>Y<sup><a href="https://browserext.github.io/browserext/#note1">1</a></sup></td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td>"page_action"<sup><a href="https://browserext.github.io/browserext/#note1">1</a></sup></td>
                            </tr>
                            <tr>
                                <th><code>runtime</code></th>
                                <td>Y</td>
                                <td>Y</td>
                                <td>Y<sup><a href="https://browserext.github.io/browserext/#note3">3</a></sup></td>
                                <td>“externally_connectable”:[...] <sup><a href="https://browserext.github.io/browserext/#note2">2</a></sup></td>
                            </tr>
                            <tr>
                                <th><code>tabs</code></th>
                                <td>Y</td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td>"permissions":["tabs","activeTab"]</td>
                            </tr>
                            <tr>
                                <th><code>webNavigation</code></th>
                                <td>Y</td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td>"permissions":["webNavigation"]</td>
                            </tr>
                            <tr>
                                <th><code>webRequest</code></th>
                                <td>Y</td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td>"permissions":["webRequest"]</td>
                            </tr>
                            <tr>
                                <th><code>windows</code></th>
                                <td>Y</td>
                                <td><p></p></td>
                                <td><p></p></td>
                                <td><p></p></td>
                            </tr>
                        </tbody></table>
                        <div id="note1" resource="#note1">
                            <sup>1</sup> Either <code>browserAction</code> or <code>pageAction</code> is allowed at the same time, not both
                        </div>
                        <div id="note2" resource="#note2">
                            <sup>2</sup>The runtime object is available for use by extensions without declaring <code>"externally_connectable"</code> in the manifest. However, an extension will only receive messages sent from hosted web pages if this key is declared. The <code>"externally_connectable"</code> declaration will block messages from other extensions, unless the allowed extension ID is declared in the <code>"ids"</code> list.
                        </div>
                        <div id="note3" resource="#note3">
                            <sup>3</sup>Internet-hosted web pages that use <code>runtime.sendMessage</code> to communicate with extensions MUST be explicitly specify the hosting site's domain in the manifest under the "externally_connectable" key.
                        </div>
                        <div id="note4" resource="#note4">
                            <sup>4</sup> Use of the <code>browser.i18n</code> object does not require a manifest permission declaration. However, the manifest does require a value (<code>default_locale</code>) that is necessary and cannot be specified by the extension author in script code.
                        </div>
                    </section>
                </section>
                <section>
                    <h4 id="web-idl">Expressing Availability in WebIDL</h4>
                    <p>This specification uses WebIDL [[WEBIDL]] to describe the Browser Extensions API.</p>
                    <section>
                        <h4>Attribute: <code>Exposed</code></h4>
                        <p>
                            To express the aforementioned conditional situations in which certain APIs are made available due to context, the following contexts are used:
                        </p>
                        <ul>
                            <li><b>Window</b> - The primary context for most browser extension APIs. This applies to background, event, popup, options and custom contexts</li>
                            <li><b>ContentScript</b> - Applies to content script context</li>
                        </ul>
                    </section>
                    <section>
                        <h4>Extended Attribute: <code>CheckAnyPermissions</code></h4>
                        <p>
                            To express the aforementioned conditional situations in which certain APIs are made available due to expressed manifest keys or permissions, the new WebIDL extended attribute <code>"<a href="https://developer.mozilla.org/en-US/docs/Mozilla/WebIDL_bindings#CheckAnyPermissions">CheckAnyPermissions</a>"</code> is used.
                        </p>
                        <table>
                            <tbody><tr><td><b>API object</b></td><td><b>CheckAnyPermissions Value</b></td><td><b>Manifest Key or Value</b></td></tr>
                            <tr><td>browser</td><td>"browserExt"</td><td>N/A</td></tr>
                            <tr><td>browser.browserAction</td><td>"browserExtBrowserAction"</td><td>"browserAction":[...]</td></tr>
                            <tr><td>browser.contextMenu</td><td>"browserExtContextMenus"</td><td>"permissions":["contextMenus"]</td></tr>
                            <tr><td>browser.extension</td><td>"browserExt"</td><td><p></p></td></tr>
                            <tr><td>i18n</td><td>"browserExt"</td><td>"default_language": "&lt;code&gt;"</td></tr>
                            <tr><td>pageAction</td><td>"browserExtPageAction"</td><td>"pageAction":[...]</td></tr>
                            <tr><td>runtime</td><td>"browserExt"</td><td><p></p></td></tr>
                            <tr><td>tabs</td><td>"browserExtTabs"</td><td>"permissions":["tabs"] or<br>"permissions":["activeTab"]</td></tr>
                            <tr><td>webNavigation</td><td>"browserExtWebNavigation"</td><td>"permissions":["webNavigation"]</td></tr>
                            <tr><td>webRequest</td><td>"browserExtWebRequest"</td><td>"permissions":["webRequest"]</td></tr>
                            <tr><td>windows</td><td>"browserExt"</td><td><p></p></td></tr>

                        </tbody></table>
                    </section>
                    <section class="example">
                        <h4>Example: <code>browser.i18n</code></h4>
                        <p>
                            In this example, the <code>i18n</code> API should be made available to both browser host scripts (background, event, popup, options, etc.) and content scripts. Use of this API does not require a manifest permission declaration. Additionally, however, the manifest does require a value (<code>default_locale</code>) that is necessary and cannot be specified by the extension author in script code. This is expressed as a <code>BrowserExtManifest</code> dictionary. </p>
                        <p>NOTE: To avoid naming conflicts with WebIDL definitions elsewhere in this document, the Example below has an underscore ("_") appended to end of interface names. In the actual definitions elsewhere in this document, the underscore character is not used.
                        </p>
                        <ol>
                            <li>
                                First, declare the methods for the <code>browser.i18n</code> object.

<pre class="idl">[NoInterfaceObject]
interface BrowserExtI18n_ {
    DOMString getMessage_(DOMString messageName, sequence&lt;DOMString?&gt; substitutions);
};
</pre>
                            </li>
                            <li>
                                Next, we specify the available contexts ("Window" for background/event/popup/options...) and "ContentScript" for the content context.

<pre class="idl">[NoInterfaceObject, Exposed=(Window,ContentScript)] 
interface BrowserExtI18nAPI_ {
    readonly attribute BrowserExtI18n_ i18n;
};
                        </pre>
                            </li>
                            <li>
                                Connect the <code>i18n</code> object to the <code>browser.*</code> object.

<pre class="idl">Browser implements BrowserExtI18nAPI_;
</pre>
                            </li>
                            <li>
                                Finally, we express the locale from manifest.json. For example <code>"default_locale": "en"</code>

<pre class="idl">partial dictionary BrowserExtManifest_ {
    DOMString? defaultLocaleValue;
};
</pre>
                            </li>
                        </ol>

                        <section class="introductory" style="display:none;">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtI18n_</dfn></dt>
                                <dd> is TBD_define_here</dd>
                                <dt> <dfn data-dfn-for="BrowserExtI18n_">getMessage_</dfn></dt>
                                <dd> is TBD_define_here</dd>
                                <dt> <dfn>BrowserExtI18nAPI_</dfn></dt>
                                <dd> is TBD_define_here</dd>
                                <dt> <dfn data-dfn-for="BrowserExtI18nAPI_">i18n</dfn></dt>
                                <dd> is TBD_define_here</dd>
                                <dt> <dfn>BrowserExtManifest_</dfn></dt>
                                <dd> is TBD_define_here</dd>
                                <dt> <dfn data-dfn-for="BrowserExtManifest_">defaultLocaleValue</dfn></dt>
                                <dd> is TBD_define_here</dd>
                            </dl>
                        </section>

                    </section>
                </section>
            <section>
                <h4 id="availability-csp"><font style="font-size:0pt;visibility:hidden;">Considerations</font>Content Security Policy (CSP) Restrictions</h4>
                <p>
                    Use of some JavaScript APIs such as <code>eval()</code> are restricted due to CSP. If an explicit policy is not specified, the default policy is applied. The default CSP is discussed in the specification [[CSP3]] . If the browser extension author specifies a new CSP, it will override the default CSP. Refer to the CSP <a href="https://browserext.github.io/browserext/#csp-overview">Overview</a> section for more information about the availability of these APIs. The <a href="https://browserext.github.io/browserext/#csp-cross-domain">Cross-domain Privileges</a> and <a href="https://browserext.github.io/browserext/#availability-csp-content">Content and Background Script Communication</a> sections provide details about API usage by content scripts.
                </p>
                <ul>
                    <li>Script execution via <code>eval()</code> and inline script execution are not allowed</li>
                    <li>Only script from the extension's package can be executed</li>
                    <li>Executing script from the web is not allowed</li>
                </ul>

            </section>
            </section>



        <section>
            <h3 id="coreapis">The <code>browser</code> object</h3>
            <section class="introductory">
                <h4>Overview</h4>
                <p>
                    The core Browser Extension API objects are accessible from the <code>browser</code> object. Their availability varies, depending on conditions outlined in the <a href="https://browserext.github.io/browserext/#apiavailability">API Availability</a> section.
                </p>
                <ul>
                    <li>browserAction</li>
                    <li>contextMenus</li>
                    <li>extension</li>
                    <li>i18n</li>
                    <li>pageAction</li>
                    <li>runtime</li>
                    <li>tabs</li>
                    <li>webNavigation</li>
                    <li>webRequest</li>
                    <li>windows</li>
                </ul>
            </section>
            <section class="introductory">
                <h4>Context</h4>
                <p>
                    This API is available in Window context (background, event, popup, options and custom pages), Content Script context, and Internet-hosted web page context.
                </p>
            </section>
            <section class="introductory">
                <h4>WebIDL Definition</h4>
                <p>
                    A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                </p>

<pre class="def idl">[CheckAnyPermissions_browserExt_]
interface BrowserExtGlobal {
    readonly attribute Browser browser;
};
Window implements BrowserExtGlobal;

[NoInterfaceObject] 
interface Browser { 
};
dictionary BrowserExtIcon {
    DOMString path;
    DOMString size;
};
typedef sequence&lt;BrowserExtIcon&gt; BrowserExtIconArray;
dictionary BrowserExtDeveloper {
    DOMString name;
    DOMString? url;
};
dictionary BrowserExtBrowserOrPageAction {
    BrowserExtIcon? defaultIcon; 
    DOMString? defaultPopup;
    DOMString? defaultTitle;
};
dictionary BrowserExtKeyValue {
    DOMString key;
    DOMString? value;
};
dictionary BrowserExtBrowserSpecificSettings {
    DOMString browserName;
    sequence&lt;BrowserExtKeyValue&gt; keyValue;
};
dictionary BrowserExtBackroundOrEvent {
    DOMString? page;
    boolean persistent;
    sequence&lt;DOMString&gt;? scripts;
};
dictionary BrowserExtContentScripts {
    boolean allFrames;
    sequence&lt;DOMString&gt;? css;
    sequence&lt;DOMString&gt;? excludeMatches;
    sequence&lt;DOMString&gt;? js;
    sequence&lt;DOMString&gt; matches;
    DOMString? runAt;
};
dictionary BrowserExtManifest {
    BrowserExtBackroundOrEvent? background;
    BrowserExtBrowserOrPageAction? browserAction;
    BrowserExtBrowserSpecificSettings? browserSpecificSettings;
    BrowserExtContentScripts? contentScripts;
    DOMString? contentSecurityPolicy;
    DOMString? defaultLocale;
    DOMString? description;
    BrowserExtDeveloper? developer;
    BrowserExtIconArray? icons;
    DOMString? manifestVersion;
    DOMString name;
    DOMString? optionsPage;
    BrowserExtBrowserOrPageAction? pageAction;
    sequence&lt;DOMString&gt;? permissions;
    sequence&lt;DOMString&gt;? requiredKeys;
    DOMString? version;
    sequence&lt;DOMString&gt; webAccessibleResources;
};
</pre>
                <section class="introductory">
                    <h4> Definitions</h4>
                    <dl>
                        <dt> <dfn>BrowserExtGlobal</dfn></dt>
                        <dd>The interface for the main <code>browser</code> object that provides access to all if the child core objects (e.g. <code>browser.browserAction</code>, <code>browser.contextMenus</code>, etc.) and their associated APIs.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtGlobal">browser</dfn></dt>
                        <dd>The core object that provides all of the browser extension APIs.</dd>
                        <dt> <dfn>Browser</dfn></dt>
                        <dd>The interface definition is empty in this section, but each subsequent spec section for the core objects (e.g. BrowserAction, ContextMenus, etc.) includes declarations (e.g. <code>Browser implements BrowserExtBrowserActionAPI</code>) that add the corresponding core objects to the <code>browser&gt;</code> object.</dd>
                        <dt> <dfn>BrowserExtIcon</dfn></dt>
                        <dd>Represents information about a graphical image for <code>BrowserAction</code> or <code>PageAction</code> buttons displayed in the browser UI.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtIcon">path</dfn></dt>
                        <dd>Specifies the relative location of the .jpg file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtIcon">size</dfn></dt>
                        <dd>Specifies the width and height of the image in pixels.</dd>
                        <dt> <dfn>BrowserExtIconArray</dfn></dt>
                        <dd>An array of <code>BrowserExtIcon</code> objects.</dd>
                        <dt> <dfn>BrowserExtDeveloper</dfn></dt>
                        <dd>Specifies information about the creator of the extension.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtDeveloper">name</dfn></dt>
                        <dd>Specifies the name or company that created the extension.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtDeveloper">url</dfn></dt>
                        <dd>Specifies the company or product URL for the extension.</dd>
                        <dt> <dfn>BrowserExtBrowserOrPageAction</dfn></dt>
                        <dd>Represents information about either a <code>BrowserAction</code> or <code>PageAction</code>.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBrowserOrPageAction">defaultIcon</dfn></dt>
                        <dd>The <code>BrowserExtIcon</code> image, if one was specified in the <code>manifest.json</code> file, or <code>null</code> if none is provided.  </dd>
                        <dt> <dfn data-dfn-for="BrowserExtBrowserOrPageAction">defaultPopup</dfn></dt>
                        <dd>The relative path to the page or script to be invoked if one was specified in the <code>manifest.json</code> file, or <code>null</code> if none is provided.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBrowserOrPageAction">defaultTitle</dfn></dt>
                        <dd>The button (or tooltip) text if specified in the <code>manifest.json</code> file, or <code>null</code> if none is provided.</dd>
                        <dt> <dfn>BrowserExtKeyValue</dfn></dt>
                        <dd>A pair of strings, one representing a lookup "key" (or index) and the other an associated "value".</dd>
                        <dt> <dfn data-dfn-for="BrowserExtKeyValue">key</dfn></dt>
                        <dd>A string lookup "key" (e.g. "color"), which provides access to an associated "value" (e.g. "red").</dd>
                        <dt> <dfn data-dfn-for="BrowserExtKeyValue">value</dfn></dt>
                        <dd>Using an associated lookup "key" (e.g. "color"), this represents the "value" (e.g. "red") for that key.</dd>
                        <dt> <dfn>BrowserExtBrowserSpecificSettings</dfn></dt>
                        <dd>Used for settings specific to a host such as Gecko, Opera, or Edge.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBrowserSpecificSettings">browserName</dfn></dt>
                        <dd>The browser name that is associated with the settings, such as "geko" or "opera" or "edge".</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBrowserSpecificSettings">keyValue</dfn></dt>
                        <dd>The pair of name and value for a setting that is only applicable to a particular browser.</dd>
                        <dt> <dfn>BrowserExtBackroundOrEvent</dfn></dt>
                        <dd>Represents <code>manifest.json</code> settings for long-running or inter-tab scripts.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBackroundOrEvent">page</dfn></dt>
                        <dd>Specifies the relative path to the page that is loaded as the Background or Event page.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBackroundOrEvent">persistent</dfn></dt>
                        <dd>Specifies whether the page is always loaded (true) or is unloaded when not needed (false), such as an idle state.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtBackroundOrEvent">scripts</dfn></dt>
                        <dd>Specifies the relative path to the script that is loaded as the Background or Event page.</dd>
                        <dt> <dfn>BrowserExtContentScripts</dfn></dt>
                        <dd>Represents the collection of information needed to associate script files to be executed when the user navigates the browser to particular URLs.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtContentScripts">allFrames</dfn></dt>
                        <dd>Specifies whether the script should be run for child frames of a page as well as the main page.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtContentScripts">css</dfn></dt>
                        <dd>Specifies relative paths to style sheets to be loaded when the matches/exclude_matches and run_at criteria are met.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtContentScripts">excludeMatches</dfn></dt>
                        <dd>Specifies URL patterns for which the content script will <i>not</i> be run.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtContentScripts">js</dfn></dt>
                        <dd>Specifies relative paths to scripts to be run when the matches/exclude_matches and run_at criteria are met.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtContentScripts">matches</dfn></dt>
                        <dd>Specifies URL patterns for which the content script will not be run.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtContentScripts">runAt</dfn></dt>
                        <dd>Specifies when scripts and CSS will be applied (e.g. "document_start" or "document_end").</dd>
                        <dt> <dfn>BrowserExtManifest</dfn></dt>
                        <dd>Represents all of the relevant data provided in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">background</dfn></dt>
                        <dd>Corresponds to the <code>"background": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">browserAction</dfn></dt>
                        <dd>Corresponds to the <code>"browser_action": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">browserSpecificSettings</dfn></dt>
                        <dd>Corresponds to the <code>"browser_specific_settings": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">contentScripts</dfn></dt>
                        <dd>Corresponds to the <code>"content_scripts": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">contentSecurityPolicy</dfn></dt>
                        <dd> Corresponds to the <code>"content_security_policy"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">defaultLocale</dfn></dt>
                        <dd>Corresponds to the <code>"default_locale"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">description</dfn></dt>
                        <dd> Corresponds to the <code>"description"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">developer</dfn></dt>
                        <dd> Corresponds to the <code>"developer": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">icons</dfn></dt>
                        <dd> Corresponds to the <code>"icons": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">manifestVersion</dfn></dt>
                        <dd> Corresponds to the <code>"manifest_version"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">name</dfn></dt>
                        <dd> Corresponds to the <code>"name"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">optionsPage</dfn></dt>
                        <dd> Corresponds to the <code>"options_page"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">pageAction</dfn></dt>
                        <dd> Corresponds to the <code>"page_action": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">permissions</dfn></dt>
                        <dd> Corresponds to the <code>"permissions": {}</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">requiredKeys</dfn></dt>
                        <dd> Corresponds to the <code>"required_keys": []</code> key and associated children in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">version</dfn></dt>
                        <dd> Corresponds to the <code>"version"</code> key/value pair in the <code>manifest.json</code> file.</dd>
                        <dt> <dfn data-dfn-for="BrowserExtManifest">webAccessibleResources</dfn></dt>
                        <dd> Corresponds to the <code>"web_accesible_resources": {}</code> key/value pair in the <code>manifest.json</code> file.</dd>
                    </dl>
                </section>
            </section>

                <section>
                    <h4 id="browserAction">The <code>browserAction</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        The <code>browserAction</code> object adds an always-visible button to the browser application, usually near the top of the browser application UI in the toolbar area. An extension that declares a <code>browserAction</code> cannot have a <code>pageAction</code>, and vice-versa.
                    </section>
                    <section class="introductory">
                        <h4>Manifest</h4>
                        The <code>"browser_action"</code> and <code>"default_title"</code> keys are required. The other keys are optional.
<pre>"browser_action": {                               // Required
    "default_icon": {...},                        // Same format as "icons"
    "default_popup": "Page URL",                  // Optional
    "default_title": "Title string"               // Required
}
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>






<pre class="def idl">dictionary BrowserExtBrowserActionDefaults {
    BrowserExtIconArray? defaultIcon;
    DOMString? defaultPopup;
    DOMString?  defaultTitle;
};
partial dictionary BrowserExtManifest {
        BrowserExtBrowserActionDefaults? browserActionDefaults;
};
typedef sequence&lt;byte&gt; BrowserExtColorArray;
dictionary BrowserExtTabIdDetails {
    long tabId;
};
dictionary BrowserExtBadgeColorArrayTabId {
    BrowserExtColorArray color;
    long tabId;
};
dictionary BrowserExtBadgePathTabId {
    DOMString path;
    long tabId;
};
dictionary BrowserExtBadgeTextTabId {
    long tabId;
    DOMString text;
};
dictionary BrowserExtBadgeTabIdPopup {
    DOMString popupHTMLFileName;
    long tabId;
};
callback BrowserExtBrowserActionOnClickedCallback = void (BrowserExtTabsTab tab);
[NoInterfaceObject]
interface BrowserExtBrowserAction {
    void disable(long tabId);
    void enable(long tabId);
    Promise&lt;BrowserExtColorArray&gt; getBadgeBackgroundColor(BrowserExtTabIdDetails details);
    Promise&lt;DOMString?&gt; getBadgeText(BrowserExtTabIdDetails details);
    Promise&lt;DOMString?&gt; getPopup(BrowserExtTabIdDetails details);
    BrowserExtEvent onClicked(BrowserExtBrowserActionOnClickedCallback callback);
    void setBadgeBackgroundColor(BrowserExtBadgeColorArrayTabId details);
    void setBadgeText(BrowserExtBadgeTextTabId details);
    Promise&lt;void&gt; setIcon(BrowserExtBadgePathTabId details);
    void setPopup(BrowserExtBadgeTabIdPopup details);
};
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExtBrowserAction_]
interface BrowserExtBrowserActionAPI {
    readonly attribute BrowserExtBrowserAction browserAction; 
};
Browser implements BrowserExtBrowserActionAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtBrowserActionDefaults</dfn></dt>
                                <dd>Represents the initial state of the BrowserAction button, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserActionDefaults">defaultIcon</dfn></dt>
                                <dd>The initial image to be displayed for the BrowserAction button in the browser UI, as specified by values in the <code>manifest.json</code> file. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserActionDefaults">defaultPopup</dfn></dt>
                                <dd>The relative path to the page to be displayed when the BrowserAction button is clicked, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserActionDefaults">defaultTitle</dfn></dt>
                                <dd>The initial text string to be displayed with the BrowserAction button in the browser UI, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtManifest">browserActionDefaults</dfn></dt>
                                <dd>Object that represents the initial state of the BrowserAction button, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn>BrowserExtColorArray</dfn></dt>
                                <dd>RGBA for the BrowserAction button's color.</dd>
                                <dt> <dfn>BrowserExtTabIdDetails</dfn></dt>
                                <dd>An object that is passed as a parameter to many <code>browser.browserAction</code> methods. The object encapsulates the information needed to execute the associated method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabIdDetails">tabId</dfn></dt>
                                <dd>The numeric integer ID representing the tab of interest.</dd>
                                <dt> <dfn>BrowserExtBadgeColorArrayTabId</dfn></dt>
                                <dd> An object that is returned as a Promise from calls to the <code>browser.getBadgeBackgroundColor</code> methods.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgeColorArrayTabId">color</dfn></dt>
                                <dd> The RGBA color of the BrowserAction button's background.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgeColorArrayTabId">tabId</dfn></dt>
                                <dd>The numeric integer ID for the associated tab.</dd>
                                <dt> <dfn>BrowserExtBadgePathTabId</dfn></dt>
                                <dd>An object that is passed as a parameter to the <code>browserAction.setIcon()</code> method. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgePathTabId">path</dfn></dt>
                                <dd>The relative path to the image to be displayed in the BrowserAction button in the UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgePathTabId">tabId</dfn></dt>
                                <dd>The numeric integer ID for the associated tab.</dd>
                                <dt> <dfn>BrowserExtBadgeTextTabId</dfn></dt>
                                <dd> An object that is passed as a parameter to the <code>browserAction.setBadgeText()</code> method. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgeTextTabId">tabId</dfn></dt>
                                <dd> The numeric integer ID for the associated tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgeTextTabId">text</dfn></dt>
                                <dd>The text string to be displayed in the BrowserAction button in the UI.</dd>
                                <dt> <dfn>BrowserExtBadgeTabIdPopup</dfn></dt>
                                <dd> An object that is passed as a parameter to the <code>browserAction.setPopup()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgeTabIdPopup">popupHTMLFileName</dfn></dt>
                                <dd> The relative path to the page to be displayed when the BrowserAction button in the UI is activated.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgeTabIdPopup">tabId</dfn></dt>
                                <dd> The numeric integer ID for the associated tab.</dd>
                                <dt> <dfn>BrowserExtBrowserActionOnClickedCallback</dfn></dt>
                                <dd>This callback handles the <code>browserAction.onClicked()</code> event.</dd>
                                <dt> <dfn>BrowserExtBrowserAction</dfn></dt>
                                <dd> The definition for the <code>browser.browserAction</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction">disable</dfn></dt>
                                <dd>Indicates that the browser should alter the BrowserAction button in the browser UI so that it cannot be activated, typically visually changing the UI as well to indicate this state to users. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction">enable</dfn></dt>
                                <dd>Indicates that the browser should alter the BrowserAction button in the browser UI so that it can be activated, typically visually changing the UI as well to indicate this state to users. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction">getBadgeBackgroundColor</dfn></dt>
                                <dd>Returns the color of background for the BrowserAction button in the UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction">getBadgeText</dfn></dt>
                                <dd>Returns the UI string for the BrowserAction button badge text.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction" data-lt="getPopup()">getPopup</dfn></dt>
                                <dd> Returns the relative path to the page to be displayed when the user actives the BrowserAction in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction" data-lt="onClicked()">onClicked</dfn></dt>
                                <dd> The event that fires when the user activates the BrowserAction button.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction">setBadgeBackgroundColor</dfn></dt>
                                <dd> Specifies a new color to be displayed in the as the background for the BrowserAction button in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction">setBadgeText</dfn></dt>
                                <dd> Specifies a new text string to be displayed in the BrowserAction button in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction" data-lt="setIcon()">setIcon</dfn></dt>
                                <dd> Specifies a new image to be displayed in the BrowserAction button in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserAction" data-lt="setPopup()">setPopup</dfn></dt>
                                <dd> Specifies the relative path to the page to be displayed when the user actives the BrowserAction in the browser UI.</dd>
                                <dt> <dfn>BrowserExtBrowserActionAPI</dfn></dt>
                                <dd> The interface for the <code>browser.browserAction</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserActionAPI">browserAction</dfn></dt>
                                <dd> The <code>browser.browserAction</code> object.</dd>
                            </dl>
                        </section>
                    </section>
                </section>


                <section>
                    <h4 id="contextMenus">The <code>contextMenus</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>contextMenus</code> object allows additional entries to be added to the browser's context menu. The menu will be selectively be shown for various browser UI elements (browser action or page action button) or page elements (frame, image, link, page, selection, etc.).
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            A <code>"contextMenus"</code> entry MUST be declared in the <code>"permissions"</code> key. The icon keys are optional.
                        </p>
<pre>"permissions": [                                  // Required
    "contextMenus"                                // Required
],                                                // Required
"icons": {                                        // Optional
    "&lt;size&gt;":"&lt;name.png&gt;"                         // Optional, size 16 recommended
}                                                 // Optional
</pre>
                    </section><section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section><section class="introductory">
    <h4>WebIDL Definition</h4>
    <p>
        A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
    </p>
<pre class="def idl">enum BrowserExtContextType { "all", "audio", "browser_action", "editable", "frame", "image", "link", "page", "page_action", "selection", "video" };
enum BrowserExtItemType { "checkbox","normal","radio","separator" };
dictionary BrowserExtContextMenuCreateDetails {
    boolean checked;
    sequence&lt;ContextType&gt;? contexts;
    sequence&lt;DOMString&gt;? documentUrlPatterns;
    boolean enabled;
    DOMString? id;
    Function onclick;
    (long or DOMString?) parentId;
    sequence&lt;DOMString&gt;? targetUrlPatterns;
    DOMString? title;
    DOMString? type;
};
dictionary BrowserExtContextMenuUpdateDetails {
    boolean checked;
    sequence&lt;BrowserExtContextType&gt;? contexts;
    sequence&lt;DOMString&gt;? documentUrlPatterns;
    boolean enabled;
    Function onclick;
    long parentId;
    sequence&lt;DOMString&gt;? targetUrlPatterns;
    DOMString? title;
    ItemType? type;
};
dictionary BrowserExtContextMenuOnClickedDetails {
    boolean checked;
    boolean editable;
    long frameId;
    DOMString? frameUrl;
    DOMString? linkUrl;
    DOMString? mediaType;
    (long or DOMString) menuItemId;
    DOMString? pageUrl;
    (long or DOMString?) parentMenuItemId;             
    DOMString? selectionText;
    DOMString? srcUrl;
    boolean wasChecked;
};
callback BrowserExtContextMenuOnClickedCallback = void (BrowserExtContextMenuOnClickedDetails details, BrowserExtTabsTab tab);
[NoInterfaceObject]
interface BrowserExtContextMenus {
    Promise&lt;long&gt; create(BrowserExtContextMenuCreateDetails details);
    BrowserExtEvent onClicked(BrowserExtContextMenuOnClickedCallback callback);
	Promise&lt;void&gt; remove((long or DOMString) itemId);
    Promise&lt;void&gt;  removeAll();
    Promise&lt;void&gt;  update((long or DOMString) itemId, BrowserExtContextMenuUpdateDetails details);
};
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExtContextMenus_]
interface BrowserExtContextMenusAPI {
    readonly attribute BrowserExtContextMenus contextMenus; 
};
Browser implements BrowserExtContextMenusAPI;
</pre>
    <section class="introductory">
        <h4> Definitions</h4>
        <dl>
            <dt> <dfn>BrowserExtContextType</dfn></dt>
            <dd> Specifies whether a context menu item is displayed for certain conditions. </dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">all</dfn></dt>
            <dd> Applies in any of the contexts.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">audio</dfn></dt>
            <dd> Applies when the user context-clicks an audio element.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">browser_action</dfn></dt>
            <dd> Applies when the user context-clicks the BrowserAction button in the browser UI.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">editable</dfn></dt>
            <dd> Applies when the user context-clicks an editable element in the active tab, like a textarea.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">frame</dfn></dt>
            <dd> Applies when the user context-clicks in a nested iframe in the active tab.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">image</dfn></dt>
            <dd> Applies when the user context-clicks an image in the active tab.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">link</dfn></dt>
            <dd> Applies when the user context-clicks on a link in the active tab.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">page</dfn></dt>
            <dd> Applies when the user context-clicks in the page in the active tab, but none of the other page contexts apply (for example, the click is not on an image or a nested iframe or a link).</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">page_action</dfn></dt>
            <dd> Applies when the user context-clicks the PageAction button in the browser UI.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">selection</dfn></dt>
            <dd> Applies when part of the page in the active tab is selected.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextType">video</dfn></dt>
            <dd> Applies when the user context-clicks a video element in the active tab.</dd>
            <dt> <dfn>BrowserExtItemType</dfn></dt>
            <dd> Defines the UI control type to be associated with menu item text.</dd>
            <dt> <dfn data-dfn-for="BrowserExtItemType">checkbox</dfn></dt>
            <dd> A context menu item that represents a binary state. It displays a checkmark next to the label. Clicking the item toggles the checkmark. The contextMenus.onClicked listener will be passed two extra properties: "checked", indicating whether the item is checked now, and "wasChecked", indicating whether the item was checked before the click event.</dd>
            <dt> <dfn data-dfn-for="BrowserExtItemType">normal</dfn></dt>
            <dd> A context menu item that just displays a label.</dd>
            <dt> <dfn data-dfn-for="BrowserExtItemType">radio</dfn></dt>
            <dd> A context menu item that represents one of a group of choices. Just like a checkbox, this also displays a checkmark next to the label, and its contextMenus.onClicked listener is passed "checked" and "wasChecked". However, if you create more than one radio item, then the items function as a group of radio items: only one item in the group can be checked, and clicking an item makes it the checked item.</dd>
            <dt> <dfn data-dfn-for="BrowserExtItemType">separator</dfn></dt>
            <dd> A line separating a group of items.</dd>
            <dt> <dfn>BrowserExtContextMenuCreateDetails</dfn></dt>
            <dd> Details for the new context menu item.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">checked</dfn></dt>
            <dd> boolean. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">contexts</dfn></dt>
            <dd> array of contextMenus.ContextType. Array of contexts in which this menu item will appear. Defaults to ['page'] if not specified.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">documentUrlPatterns</dfn></dt>
            <dd> array of string. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">enabled</dfn></dt>
            <dd> boolean. Whether this context menu item is enabled or disabled. Defaults to true.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">id</dfn></dt>
            <dd> string. The unique ID to assign to this item. Mandatory for event pages. Cannot be the same as another ID for this extension.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">onclick</dfn></dt>
            <dd> function. A function that will be called when the menu item is clicked. Event pages cannot use this: instead, they should register a listener for contextMenus.onClicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">parentId</dfn></dt>
            <dd> integer or string. The ID of a parent menu item; this makes the item a child of a previously added item.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">targetUrlPatterns</dfn></dt>
            <dd> array of string. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">title</dfn></dt>
            <dd> istring. The text to be displayed in the item. Mandatory unless type is "separator".
You can use "%s" in the string. If you do this, and some text is selected in the page when the context menu is shown, then the selected text will be interpolated into the title. For example, if title is "Translate '%s' to Pig Latin" and the user selects the word "cool", then activates the context menu, then the context menu item's title will be: "Translate 'cool' to Pig Latin".</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuCreateDetails">type</dfn></dt>
            <dd> contextMenus.ItemType. The type of menu item: "normal", "checkbox", "radio", "separator". Defaults to "normal".</dd>
            <dt> <dfn>BrowserExtContextMenuUpdateDetails</dfn></dt>
            <dd> The details to update. Accepts the same values as create().</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">checked</dfn></dt>
            <dd> boolean. The initial state of a checkbox or radio item: true for selected and false for unselected. Only one radio item can be selected at a time in a given group of radio items.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">contexts</dfn></dt>
            <dd> array of contextMenus.ContextType. Array of contexts in which this menu item will appear. Defaults to ['page'] if not specified.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">documentUrlPatterns</dfn></dt>
            <dd> array of string. Lets you restrict the item to apply only to documents whose URL matches one of the given match patterns. This applies to frames as well.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">enabled</dfn></dt>
            <dd> boolean. Whether this context menu item is enabled or disabled. Defaults to true.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">onclick</dfn></dt>
            <dd> function. A function that will be called when the menu item is clicked. Event pages cannot use this: instead, they should register a listener for contextMenus.onClicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">parentId</dfn></dt>
            <dd> integer or string.&nbsp; The ID of a parent menu item; this makes the item a child of a previously added item. Note: You cannot change an item to be a child of one of its own descendants.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">targetUrlPatterns</dfn></dt>
            <dd> array of string. Similar to documentUrlPatterns, but lets you filter based on the src attribute of img/audio/video tags and the href of anchor tags.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">title</dfn></dt>
            <dd> string. The text to be displayed in the item; this is mandatory unless type is "separator".</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuUpdateDetails">type</dfn></dt>
            <dd> contextMenus.ItemType. The type of menu item: "normal", "checkbox", "radio", "separator". Defaults to "normal".</dd>
            <dt> <dfn>BrowserExtContextMenuOnClickedDetails</dfn></dt>
            <dd> Information sent when a context menu item is clicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">checked</dfn></dt>
            <dd> boolean. A flag indicating whether a checkbox or radio item was checked after it was clicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">editable</dfn></dt>
            <dd> boolean. A flag indicating whether the element is editable: for example, if it is a textarea.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">frameId</dfn></dt>
            <dd> integer or string. The ID of the frame that was clicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">frameUrl</dfn></dt>
            <dd> string. The URL of the frame of the element where the context menu was clicked, if it was in a frame.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">linkUrl</dfn></dt>
            <dd> string. If the element is a link, the URL it points to.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">mediaType</dfn></dt>
            <dd> string. One of "image", "video", or "audio" if the context menu was activated on one of these types of elements.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">menuItemId</dfn></dt>
            <dd> integer or string. The ID of the menu item that was clicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">pageUrl</dfn></dt>
            <dd> string. The URL of the page in which the menu item was clicked. This property is not present if the click occured in a context where there is no current page, such as on a browser action.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">parentMenuItemId</dfn></dt>
            <dd> integer or string. The parent ID, if any, for the item clicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">selectionText</dfn></dt>
            <dd> string. If some text was selected in the page, this contains the selected text./dd&gt;
            </dd><dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">srcUrl</dfn></dt>
            <dd> string. Will be present for elements with a "src" URL.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenuOnClickedDetails">wasChecked</dfn></dt>
            <dd> boolean. A flag indicating whether a checkbox or radio item was checked before it was clicked.</dd>
            <dt> <dfn>BrowserExtContextMenuOnClickedCallback</dfn></dt>
            <dd> The callback for the <code>browser.contextMenus</code> object.</dd>
            <dt> <dfn>BrowserExtContextMenus</dfn></dt>
            <dd> Defines the <code>browser.contextMenus</code> object.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenus">create</dfn></dt>
            <dd> Creates a new context menu item, given an options object defining properties for the item.
Unlike other asynchronous functions, this one does not return a promise, but uses an optional callback to communicate success or failure. This is because its return value is the ID of the new item.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenus" data-lt="onClicked()">BrowserExtContextMenus.onClicked</dfn></dt>
            <dd> Fired when a context menu item is clicked.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenus">remove</dfn></dt>
            <dd> Removes a context menu item.
This is an asynchronous function that returns a Promise.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenus">removeAll</dfn></dt>
            <dd> Removes all context menu items added by this extension.
This is an asynchronous function that returns a Promise.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenus">update</dfn></dt>
            <dd> Updates a previously created context menu item.
This is an asynchronous function that returns a Promise.</dd>
            <dt> <dfn>BrowserExtContextMenusAPI</dfn></dt>
            <dd> The interface for the <code>browser.contextMenus</code> object.</dd>
            <dt> <dfn data-dfn-for="BrowserExtContextMenusAPI">contextMenus</dfn></dt>
            <dd> The <code>browser.contextMenus</code> object.</dd>
        </dl>
    </section>

    </section>
</section>


                <section>
                    <h4 id="i18n">The <code>i18n</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>i81n</code> object provides a way to access strings that have been localized into supported languages.
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            When providing localized strings, you MUST specify a default locale using a two-character code. Codes can be found at <a href="http://www.w3.org/TR/1999/REC-html401-19991224/struct/dirlang.html">RFC1766</a> or <a href="http://www.w3.org/International/articles/language-tags/">IETF BCP47</a>. When localizing manifest strings, the following syntax is used.
                        </p>
<pre>"default_locale" : "&lt;twoCharLocaleCode&gt;",              // Required
"name" : "__MSG_&lt;yourCustomNameStringIdentifier&gt;__",
"description" : "__MSG_&lt;yourCustomDescriptionStringIdentifier&gt;__",
</pre>
                        For example
                        <pre>"default_locale" : "en",              // English
"name" : "__MSG_MySampleExtension__",
"description" : "__MSG_MySampleExensionDecription__",
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Localized Strings</h4>
                        <p>
                            Each supported locale MUST have its own <code>messages.json</code> file stored in the folder <code>_locales/&lt;twoCharLocaleCode&gt;</code>. The two-character codes used for directory names here the same as are used in the <code>mainfest.json</code> to specify <code>default_locale</code>.
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>Locale Codes and Matching</h4>
                        <p>Locale codes used in file/directory names and returned by the API, contrary to common standards, are in the form:</p>
                        <code> &lt;language&gt;[_&lt;region&gt;] </code>
                        <p>
                            Which is to say, a two-letter language code, optionally followed by an underscore and a two-letter region code.
                            Locale codes are matched such that an exact match is used if available, falling back to the least-specific, closest match. Therefore, for "en_US", the following locales would be chosen, in order of preference:
                        </p>
                        <ul>
                            <li>en_US</li>
                            <li>en_US_var</li>
                            <li>en</li>
                            <li>en_GB</li>
                            <li>en_GB_var</li>
                        </ul>
                        <p></p>
                    </section>
                    <section class="introductory">
                        <h4>String tokens</h4>
                        <p>Strings are localized by pre-processing messages, replacing <code>|$[a-zA-Z0-9@_]+$|</code> tokens with the value of their replacements. Later, it processes the resulting string for <code>|$[0-9]|</code> replacements.</p><p>
                        </p><p>Any number of sequential |$|s are permitted, and are replaced with that number minus 1. Instances of <code>|$|</code> followed by any number of sequential digits is also permitted, but a localized string which provides more than 9 substitutions are ignored.</p>
                    </section>

                    <section class="introductory">
                        <h4>Locale Message Replacement</h4>
                        <p>
                            Locale messages in the form <code>__MSG_&lt;message name&gt;_</code> are automatically replaced with the appropriate localized message in CSS files and certain manifest.json string values.
                            Specifically, the replacements are done according to the regular expression <code>__MSG_([A-Za-z0-9@_]+?)__</code>, meaning that the first occurrence of __ terminates the message name immediately.
                        </p>
                        <p>
                            CSS files are pre-processed as a raw text stream, with no considerations for CSS syntax.
                            <code>manifest.json</code> values are processed after the JSON has been parsed, and the results are always treated as literal strings. The following manifest keys are processed for localization messges:
                        </p>
                        <ul>
                            <li>name
                            </li><li>short_name
                            </li><li>description
                            </li><li>author
                            </li><li>homepage_url
                            </li><li>developer.name
                            </li><li>developer.url
                            </li><li>browser_action.default_title
                            </li><li>browser_action.default_url
                            </li><li>page_action.default_title
                            </li><li>page_action.default_url
                        </li></ul>
                        <p></p>
                    </section>
                    <section class="introductory">
                        <h4>Placeholders</h4>
                        <p>It is possible for a translated string to contain substrings that will not be translated or will be replaced with variable content. For example</p>
                        <pre>"messageExample": {
    "message": "You clicked $URL$.",
    "description": "Tells the user which link they clicked.",
    "placeholders": {
      "url" : {
        "content" : "$1"
        "example" : "https://www.w3.org"
      }
</pre>
                        <p>The placeholder <code>name</code> ("url" in the above example) is used to represent the placeholder in the substitution string (e.g. "url" becomes $URL$). It is case insensitive and can contain the same characters as a message string name.</p>
                        <p>The <code>"content"</code> item defines the content of the placeholder. This can be a hardcoded string, such as "My placeholder", but it can also include values obtained from a i18n.getMessage() call. </p>
                        <p>The optional <code>"example"</code> item is intended to help translators by showing them an example of how the placeholder would appear to end users, allowing them to make the best choice when localizing the file.</p>
                    </section>

                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages) and Content Script context.
                        </p>
                    </section><section class="introductory">
    <h4>WebIDL Definition</h4>
    <p>
        A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
    </p>

<pre class="def idl">    
[NoInterfaceObject]
interface BrowserExtI18n {
    DOMString getMessage(DOMString messageName, sequence&lt;DOMString?&gt;? substitutions);
};
[NoInterfaceObject, Exposed=(Window,ContentScript), CheckAnyPermissions_browserExt_] 
interface BrowserExtI18nAPI {
        readonly attribute BrowserExtI18n i18n;
};
Browser implements BrowserExtI18nAPI;
partial dictionary BrowserExtManifest {
    DOMString? defaultLocaleValue;
};
</pre>
    <section class="introductory">
        <h4> Definitions</h4>
        <dl>
            <dt> <dfn>BrowserExtI18n</dfn></dt>
            <dd>Interface for retrieving strings that have been translated into the appropriate language and format for a corresponding locale.</dd>
            <dt> <dfn data-dfn-for="BrowserExtI18n">getMessage</dfn></dt>
            <dd> Gets the localized string for the specified message.</dd>
            <dt> <dfn>BrowserExtI18nAPI</dfn></dt>
            <dd> The interface for the <code>browser.i18n</code> object.</dd>
            <dt> <dfn data-dfn-for="BrowserExtI18nAPI">i18n</dfn></dt>
            <dd> The <code>browser.i18n</code> object.</dd>
            <dt> <dfn data-dfn-for="BrowserExtManifest">defaultLocaleValue</dfn></dt>
            <dd> This key must be present in <code>manifest.json</code>if the extension contains the _locales directory, and must be absent otherwise. It identifies a subdirectory of _locales, and this subdirectory will be used to find the default strings for your extension.</dd>
        </dl>
    </section>
                

    </section>
</section>

                <section>
                    <h4 id="pageAction">The <code>pageAction</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>pageAction</code> object adds a button to the browser application, usually within the address bar. This button typically appears only when the extension has detected that it can perform an action on the current page for the active tab. An extension that declares a <code>browserAction</code> cannot have a <code>pageAction</code>, and vice-versa.
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            The <code>"page_action"</code> and <code>"default_title"</code> keys are required. The other keys are optional.
                        </p>
<pre>"page_action": {                               // Required
    "default_icon": {...},                        // Same format as "icons"
    "default_popup": "Page URL",                  // Optional
    "default_title": "Title string"               // Required
}
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>

<pre class="def idl">dictionary BrowserExtPageActionDefaults {
    BrowserExtIconArray? defaultIcon;
    DOMString? defaultPopup;
    DOMString?  defaultTitle;
};
partial dictionary BrowserExtManifest {
    BrowserExtPageActionDefaults? pageActionDefaults;
};
dictionary BrowserExtBadgePath {
    DOMString path;
};
callback BrowserExtPageActionOnClickedCallback = void (BrowserExtTabsTab tab);
interface BrowserExtPageAction {
    Promise&lt;DOMString?&gt; getPopup(BrowserExtTabIdDetails details);
    Promise&lt;DOMString?&gt; getTitle(BrowserExtTabIdDetails details);
    void hide(long tabId);
    BrowserExtEvent onClicked(BrowserExtPageActionOnClickedCallback callback);
    Promise&lt;void&gt; setIcon(BrowserExtBadgePath path);
    void setPopup(BrowserExtBadgePathTabId details);
    void setTitle(BrowserExtBadgeTextTabId details);
    void show(long tabId);
};
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExtPageAction_]
interface BrowserExtPageActionAPI {
    readonly attribute BrowserExtPageAction pageAction; 
};
Browser implements BrowserExtPageActionAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtPageActionDefaults</dfn></dt>
                                <dd> Represents the initial state of the PageAction button, as specified by values in the <code>manifest.json</code> file</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageActionDefaults">defaultIcon</dfn></dt>
                                <dd> The initial image to be displayed for the PageAction button in the browser UI, as specified by values in the <code>manifest.json</code> file. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageActionDefaults">defaultPopup</dfn></dt>
                                <dd> The relative path to the page to be displayed when the PageAction button is clicked, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageActionDefaults">defaultTitle</dfn></dt>
                                <dd> The initial text string to be displayed with the BrowserAction button in the browser UI, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtManifest">pageActionDefaults</dfn></dt>
                                <dd> Object that represents the initial state of the PageAction button, as specified by values in the <code>manifest.json</code> file.</dd>
                                <dt> <dfn>BrowserExtBadgePath</dfn></dt>
                                <dd> An object that is passed as a parameter to the <code>pageAction.setIcon()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBadgePath">path</dfn></dt>
                                <dd> The relative path to the image to be displayed in the PageAction button in the UI.</dd>
                                <dt> <dfn>BrowserExtPageActionOnClickedCallback</dfn></dt>
                                <dd> This callback handles the <code>pageAction.onClicked()</code> event.</dd>
                                <dt> <dfn>BrowserExtPageAction</dfn></dt>
                                <dd> The definition for the <code>browser.pageAction</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction" data-lt="getPopup()">getPopup</dfn></dt>
                                <dd> Returns the relative path to the page to be displayed when the user actives the PageAction in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction">getTitle</dfn></dt>
                                <dd> Returns the UI string for the PageAction button title text.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction">hide</dfn></dt>
                                <dd> Hides the page action for a given tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction" data-lt="onClicked()">onClicked</dfn></dt>
                                <dd> The event that fires when the user activates the PageAction button.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction" data-lt="setIcon()">setIcon</dfn></dt>
                                <dd> Specifies a new image to be displayed in the PageAction button in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction" data-lt="setPopup()">setPopup</dfn></dt>
                                <dd> Specifies the relative path to the page to be displayed when the user actives the PageAction in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction">setTitle</dfn></dt>
                                <dd> Specifies a new text string to be displayed for the PageAction button in the browser UI.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageAction">show</dfn></dt>
                                <dd> integer. The ID of the tab for which you want to show the page action.</dd>
                                <dt> <dfn>BrowserExtPageActionAPI</dfn></dt>
                                <dd> The interface for the <code>browser.pageAction</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtPageActionAPI">pageAction</dfn></dt>
                                <dd> The <code>browser.pageAction</code> object.</dd>


                                
                            </dl>
                            </section>
                        </section>
                    </section>

                <section>
                    <h4 id="runtime">The <code>runtime</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>runtime</code> object is used to send and receive messages across contexts, as well as access extension-level information such as the id, manifest, and absolute path to resources.
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            There are no additional manifest entries required for an extension to use this object. However, an extension will only receive messages sent from hosted web pages if the “externally_connectable” key is declared. Also, an extension will block messages from other extensions by specifying only approved extensions. Note that if this key is used to allow web pages to send messages, unless <code>"ids" : ["*"]</code> is specified, all messages from other extensions will be blocked. URLs in the <code>"matches"</code> array MUST include a top-level domain. This list does not affect content scripts.
                        </p>
<pre>"externally_connectable" : [
    "ids":[...], // Identifiers for other extensions that are allowed to send messages
    "matches":[...] // URL patterns for hosted web pages allowed to send messages 
    ]
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages), Content Script context, and Internet-hosted web page context.
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>

<pre class="def idl">enum BrowserExtRuntimeOnInstalledReason {"browser_update", "extension_install", "extension_update"};
dictionary BrowserExtRuntimeOnInstalledDetails {
    BrowserExtRuntimeOnInstalledReason reason;
    DOMString? previousVersion;
    DOMString? id;
};
dictionary BrowserExtRuntimePort {
    Function disconnect;
    DOMString name;
    object onDisconnect;
    object onMessage;
    Function postMessage;
    BrowserExtRuntimeMessageSender? sender;
};
dictionary BrowserExtRuntimeMessageSender {
    DOMString? id;
    long frameId;
    BrowserExtTabsTab? tab;
    DOMString? url;
};
callback BrowserExtRuntimeOnConnectCallback = void (BrowserExtRuntimePort port);
callback BrowserExtRuntimeOnInstalledCallback = void (BrowserExtRuntimeOnInstalledDetails details);
callback BrowserExtRuntimeOnMessageCallback = void (optional any message, BrowserExtRuntimeMessageSender sender, BrowserExtRuntimeSendResponseCallback callback);
[NoInterfaceObject]
interface BrowserExtBrowserRuntime {
    object getManifest();
    DOMString getURL(DOMString path);
    attribute DOMString id;
    void onConnect(BrowserExtRuntimeOnConnectCallback callback);
    void onInstalled(BrowserExtRuntimeOnInstalledCallback callback);
    void onMessage(BrowserExtRuntimeOnMessageCallback callback);
    Promise&lt;any&gt; sendMessage(optional DOMString extensionId, any message);
    attribute BrowserExtRuntimePort Port;
    attribute BrowserExtRuntimeMessageSender MessageSender;
};
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExt_]
interface BrowserExtRuntimeAPI {
    readonly attribute BrowserExtRuntime runtime; 
};
Browser implements BrowserExtRuntimeAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtRuntimeOnInstalledReason</dfn></dt>
                                <dd> The reason that the <code>runtime.onInstalled</code> event is being dispatched.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeOnInstalledReason">browser_update</dfn></dt>
                                <dd> The browser was updated to a new version.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeOnInstalledReason">extension_install</dfn></dt>
                                <dd> The extension was installed.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeOnInstalledReason">extension_update</dfn></dt>
                                <dd> The extension was updated to a new version.</dd>
                                <dt> <dfn>BrowserExtRuntimeOnInstalledDetails</dfn></dt>
                                <dd> Details provided when the <code>runtime.onInstalled</code> event is fired.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeOnInstalledDetails">reason</dfn></dt>
                                <dd> A <code>runtime.OnInstalledReason</code> value stating the reason that this event is being dispatched.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeOnInstalledDetails">previousVersion</dfn></dt>
                                <dd> string. Indicates the previous version of the extension that was just updated. This is present only if the <code>reason</code> value is <code>update.</code></dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeOnInstalledDetails">id</dfn></dt>
                                <dd> string. Indicates the ID of the module that updated.</dd>
                                <dt> <dfn>BrowserExtRuntimePort</dfn></dt>
                                <dd> Represents one end of a connection between two specific contexts, which can be used to exchange messages.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimePort">disconnect</dfn></dt>
                                <dd> function. Disconnects a port. Either end can call this when they have finished with the port. It will cause onDisconnect to be fired at the other end. This is useful if the other end is maintaining some state relating to this port, which can be cleaned up on disconnect. If this port is connected to a native application, this function will close the native application.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimePort">name</dfn></dt>
                                <dd> string. The port's name, defined in the <code>runtime.connect()</code> or <code>tabs.connect()</code> call that created it. If this port is connected to a native application, its name is the name of the native application.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimePort">onDisconnect</dfn></dt>
                                <dd> object. This contains the <code>addListener()</code> and <code>removeListener()</code> functions common to all events in browser extensions. Listener functions will be called when the other end has called Port.disconnect(). This event will only be fired once for each port. The listener function will be passed the Port object. If the port was disconnected due to an error, then the Port argument will contain an error property giving more information about the error.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimePort">onMessage</dfn></dt>
                                <dd> object. This contains the <code>addListener()</code> and <code>removeListener()</code> functions common to all events in browser extensions. Listener functions will be called when the other end has sent this port a message. The listener will be passed the JSON object that the other end sent.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimePort">postMessage</dfn></dt>
                                <dd> function. Send a message to the other end. This takes one argument, which is a JSON object representing the message to send. It will be delivered to any script listening to the port's onMessage event, or to the native application if this port is connected to a native application.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimePort">sender</dfn></dt>
                                <dd> Contains information about the sender of the message. This property will only be present on ports passed to <code>onConnect</code> or <code>onConnectExternal</code> listeners.</dd>
                                <dt> <dfn>BrowserExtRuntimeMessageSender</dfn></dt>
                                <dd> An object containing information about the sender of a message or connection request.  </dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeMessageSender">id</dfn></dt>
                                <dd> string. The ID of the extension that sent the message, if the message was sent by an extension. Note that this is the extension's internal ID, not the ID in the manifest.json applications key.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeMessageSender">frameId</dfn></dt>
                                <dd> integer. The frame that opened the connection. Zero for top-level frames, positive for child frames. This will only be set when tab is set.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeMessageSender">tab</dfn></dt>
                                <dd> The <code>tabs.Tab</code> which opened the connection. This property will only be present when the connection was opened from a tab (including content scripts).</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeMessageSender">url</dfn></dt>
                                <dd> string. The URL of the page or frame hosting the script that sent the message.</dd>

                                <dt> <dfn>BrowserExtRuntimeOnConnectCallback</dfn></dt>
                                <dd> The callback fired when a connection is made with either an extension process or a content script.</dd>
                                <dt> <dfn>BrowserExtRuntimeOnInstalledCallback</dfn></dt>
                                <dd> The callback fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version.</dd>
                                <dt> <dfn>BrowserExtRuntimeOnMessageCallback</dfn></dt>
                                <dd> The callback used to listen for messages from another part of your browser extension.  </dd>
                                <dt> <dfn>BrowserExtBrowserRuntime</dfn></dt>
                                <dd> The definition for the <code>browser.runtime</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">getManifest</dfn></dt>
                                <dd> Get the complete <code>manifest.json</code> file, serialized to a JSON object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">getURL</dfn></dt>
                                <dd> Given a relative path from the <code>manifest.json</code> to a resource packaged with the browser extension, return a fully-qualified URL.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">id</dfn></dt>
                                <dd> The ID for this browser extension.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">onConnect</dfn></dt>
                                <dd> Fired when a connection is made with either a browser extension process or a content script.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">onInstalled</dfn></dt>
                                <dd> Fired when the extension is first installed, when the extension is updated to a new version, and when the browser is updated to a new version./dd&gt;
                                </dd><dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">onMessage</dfn></dt>
                                <dd>Use this event to listen for messages from another part of your browser extension.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime" data-lt="sendMessage()">sendMessage</dfn></dt>
                                <dd> Sends a single message to event listeners within your extension or a different extension.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">Port</dfn></dt>
                                <dd> Represents one end of a connection between two specific contexts, which can be used to exchange messages.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserRuntime">MessageSender</dfn></dt>
                                <dd> An object containing information about the sender of a message or connection request.</dd>

                                <dt> <dfn>BrowserExtRuntimeAPI</dfn></dt>
                                <dd> The interface for the <code>browser.runtime</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRuntimeAPI">runtime</dfn></dt>
                                <dd> The <code>browser.runtime</code> object.</dd>
                                </dl>
                            </section>
                        </section>
                    </section>

                <section>
                    <h4 id="tabs">The <code>tabs</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>tabs</code> object is used to access metadata about a tab, such as its title, or to access the current content within the tab itself.
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            The <code>"tabs"</code> permission is required to use this object. Refer to the <a href="https://browserext.github.io/browserext/#active-tab"><code>activeTab</code> permission</a> section for more information about accessing these APIs.
                        </p>
<pre>{
    "permissions": [                               // Required
        "tabs"                                     // Either "tabs" or "activeTab" is required
        "activeTab"                                // Either "tabs" or "activeTab" is required
    ]                                              // Required   
}
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>


                        <pre class="def idl">enum BrowserExtTabMutedReasonDetails { "user", "capture", "extension" };
enum BrowserExtRunAt { "document_end", "document_idle", "document_start" };
enum BrowserExtTabStatus { "complete", "loading" };
enum BrowserExtWindowTypes { "app", "normal", "panel", "popup" };
enum BrowserExtTabsCaptureVisibleTabFormat { "jpeg", "png" };
dictionary BrowserExtTabsTab {
    boolean active;
    boolean audible;
    DOMString? favIconUrl;
    boolean highlighted;
    long height;
    long id;
    boolean incognito;
    long index;
    TabMutedDetails? mutedDetails;
    long openerTabId;
    boolean pinned;
    DOMString? sessionId;
    DOMString? status;
    DOMString? title;
    DOMString? url;
    long width;
    long windowId;
};
dictionary BrowserExtTabMutedDetails {
    DOMString? extensionId;
    boolean muted;
    TabMutedReasonDetails? reason;
};
dictionary BrowserExtTabConnectDetails {
    long frameId;
    DOMString? name;
};
dictionary BrowserExtTabCreateDetails {
    boolean active;
    long index;
    long openerTabId;
    boolean pinned;
    DOMString? url;
    long windowId;
};
dictionary BrowserExtTabScriptAndCSSDetails {
    boolean allFrames;
    DOMString? code;
    DOMString? file;
    long frameId;
    boolean matchAboutBlank;
    BrowserExtRunAt? runAt;
};
dictionary BrowserExtTabsCaptureVisibleTabDetails {
    BrowserExtTabsCaptureVisibleTabFormat imageCaptureFormat;
    long jpegQuality;
};
dictionary BrowserExtTabQueryDetails {
    boolean active;
    boolean audible;  
    boolean currentWindow;
    boolean highlighted;
    long index;
    boolean lastFocusedWindow;
    boolean muted;
    boolean pinned;
    TabStatus? status;
    DOMString? title;
    (DOMString? or sequence&lt;DOMString&gt;?) url;
    long windowId;
    WindowType? windowType;
};
dictionary BrowserExtTabReloadDetails {
    boolean bypassCache;
};
dictionary BrowserExtTabSendMessageDetails {
    long frameId;
};
dictionary BrowserExtTabUpdateDetails {
    boolean active;
    boolean highlighted;
    boolean muted;
    long openerTabId;
    boolean pinned;
    DOMString? url;
};
dictionary BrowserExtTabIdWindowId {
    long tabId;
    long windowId;
};
dictionary BrowserExtTabsWindowIdIsWindowClosing {
    boolean isWindowClosing;
    long windowId;
};
dictionary BrowserExtTabsOnUpdatedChangeDetails {
    boolean audible;    
    DOMString? favIconUrl;
    TabMutedDetails? mutedDetails;
    boolean pinned;
    DOMString? status;
    DOMString? title;
    DOMString? url;
};
callback BrowserExtTabsOnActivatedCallback = void (BrowserExtTabIdWindowId activeDetails);
callback BrowserExtTabsOnCreatedCallback = void (BrowserExtTabTab tab);
callback BrowserExtTabsOnRemovedCallback = void (long tabId, BrowserExtTabsWindowIdIsWindowClosing removeDetails);
callback BrowserExtTabsOnUpdatedCallback = void (long tabId, BrowserExtTabsOnUpdatedChangeDetails details, BrowserExtTabsTab tab);
[NoInterfaceObject]
interface BrowserExtBrowserTabs {
    Promise&lt;DOMString&gt; captureVisibleTab(long windowId, BrowserExtTabsCaptureVisibleTabDetails details);
    RuntimePort connect(long tabId, BrowserExtTabConnectDetails details);
    Promise&lt;BrowserExtTabsTab&gt; create(BrowserExtTabCreateDetails details);
    void executeScript(long tabId, BrowserExtTabScriptAndCSSDetails details);
    Promise&lt;BrowserExtTabsTab&gt; get(long tabId);
    Promise&lt;BrowserExtTabsTab&gt; getCurrent();
    void insertCSS(long tabId, BrowserExtTabScriptAndCSSDetails details);
    void onActivated(BrowserExtTabsOnActivatedCallback callback);
    void onCreated(BrowserExtTabsOnCreatedCallback callback);
    void onRemoved(BrowserExtTabsOnRemovedCallback callback);
    void onUpdated(BrowserExtTabsOnUpdatedCallback callback);
    Promise&lt;BrowserExtTabsTab&gt; query(BrowserExtTabQueryDetails queryDetails);
    Promise&lt;void&gt; reload(BrowserExtTabReloadDetails details);
    Promise&lt;void&gt; remove((long or sequence&lt;long&gt;) tabIds);
    Promise&lt;any&gt; sendMessage(long tabId, any message, optional BrowserExtTabSendMessageOptions details);
    Promise&lt;BrowserExtTabsTab&gt; update(optional long tabId, BrowserExtTabUpdateDetails details);
};
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExtTabs_]
interface BrowserExtTabsAPI {
readonly attribute BrowserExtTabs tabs; 
};
Browser implements BrowserExtTabsAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtTabMutedReasonDetails</dfn></dt>
                                <dd> Specifies the reason a tab was muted or unmuted.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabMutedReasonDetails">user</dfn></dt>
                                <dd> The user set the muted state.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabMutedReasonDetails">capture</dfn></dt>
                                <dd> Tab capture started, forcing a muted state change.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabMutedReasonDetails">extension</dfn></dt>
                                <dd> An extension set the muted state. If this is the reason, extensionId in <code>tabs.mutedInfo</code> will contain the ID of the extension responsible.</dd>

                                <dt> <dfn>BrowserExtRunAt</dfn></dt>
                                <dd> The soonest that the code will be injected into the tab. Defaults to <code>"document_idle"</code>.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRunAt">document_end</dfn></dt>
                                <dd> Corresponds to <code>interactive</code>. The DOM has finished loading, but resources such as scripts and images may still be loading.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRunAt">document_idle</dfn></dt>
                                <dd> Corresponds to <code>complete</code>. The document and all its resources have finished loading.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtRunAt">document_start</dfn></dt>
                                <dd> Corresponds to <code>loading</code>. The DOM is still loading.</dd>

                                <dt> <dfn>BrowserExtTabStatus</dfn></dt>
                                <dd> The status of the tab. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabStatus">complete</dfn></dt>
                                <dd> Tab is finished loading.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabStatus">loading</dfn></dt>
                                <dd> Tab is not finished loading.</dd>

                                <dt> <dfn>BrowserExtWindowTypes</dfn></dt>
                                <dd> The type of window that hosts this tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowTypes">app</dfn></dt>
                                <dd> Application host window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowTypes">normal</dfn></dt>
                                <dd> Normal host window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowTypes">panel</dfn></dt>
                                <dd> Panel host window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowTypes">popup</dfn></dt>
                                <dd> Popup host window.</dd>

                                <dt> <dfn>BrowserExtTabsCaptureVisibleTabFormat</dfn></dt>
                                <dd> The format of an image.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsCaptureVisibleTabFormat">jpeg</dfn></dt>
                                <dd> JPEG image format.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsCaptureVisibleTabFormat">png</dfn></dt>
                                <dd> PNG image format.</dd>

                                <dt> <dfn>BrowserExtTabsTab</dfn></dt>
                                <dd> Contains information about a tab. This provides access to information about what content is in the tab, how large the content is, what special states or restrictions are in effect, and so forth.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">active</dfn></dt>
                                <dd> boolean. Whether the tab is active in its window. This may be true even if the tab's window is not currently focused.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">audible</dfn></dt>
                                <dd> boolean. If the tab is not muted: whether the tab is producing sound. If the tab is muted: whether the tab would be producing sound, if it were not muted.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">favIconUrl</dfn></dt>
                                <dd> string. The URL of the tab's favicon. Only present if the extension has the "tabs" permission. It may also be an empty string if the tab is loading.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">highlighted</dfn></dt>
                                <dd> boolean. Whether the tab is highlighted.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">height</dfn></dt>
                                <dd> integer. The height of the tab in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">id</dfn></dt>
                                <dd> integer. The tab's ID. Tab IDs are unique within a browser session. The tab ID may also be set to <code>tabs.TAB_ID_NONE</code> for browser windows that don't host content tabs (for example, devtools windows).</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">incognito</dfn></dt>
                                <dd> boolean. Whether the tab is in a private browsing window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">index</dfn></dt>
                                <dd> integer. The zero-based index of the tab within its window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">mutedDetails</dfn></dt>
                                <dd> The current muted state for the tab and the reason for the last state change.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">openerTabId</dfn></dt>
                                <dd> integer. The ID of the tab that opened this tab, if any. This property is only present if the opener tab still exists.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">pinned</dfn></dt>
                                <dd> boolean. Whether the tab is pinned.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">sessionId</dfn></dt>
                                <dd> string. The session ID used to uniquely identify a Tab obtained from the <code>sessions</code> API.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">status</dfn></dt>
                                <dd> string. Either <i>loading</i> or <i>complete</i>.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">title</dfn></dt>
                                <dd>string. The title of the tab. Only present if the extension has the "tabs" permission.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">url</dfn></dt>
                                <dd> string. The URL of the document that the tab is displaying. Only present if the extension has the "tabs" permission.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">width</dfn></dt>
                                <dd> integer. The width of the tab in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsTab">windowId</dfn></dt>
                                <dd> integer. The ID of the window that hosts this tab.</dd>

                                <dt> <dfn>BrowserExtTabMutedDetails</dfn></dt>
                                <dd> This object contains a boolean indicating whether the tab is muted, and the reason for the last state change.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabMutedDetails">extensionId</dfn></dt>
                                <dd> string. The ID of the extension that last changed the muted state. Not set if an extension was not the reason the muted state last changed.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabMutedDetails">muted</dfn></dt>
                                <dd> boolean. Whether the tab is currently muted. Equivalent to whether the muted audio indicator is showing.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabMutedDetails">reason</dfn></dt>
                                <dd> The reason the tab was muted or unmuted. Not set if the tab's muted state has never been changed.</dd>

                                <dt> <dfn>BrowserExtTabConnectDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.connect()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabConnectDetails">frameId</dfn></dt>
                                <dd> integer. Open a port to a specific frame identified by frameId instead of all frames in the tab</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabConnectDetails">name</dfn></dt>
                                <dd> string. Will be passed into <code>runtime.onConnect</code> event listeners in content scripts belonging to this extension and running in the specified tab.</dd>

                                <dt> <dfn>BrowserExtTabCreateDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.create()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabCreateDetails">active</dfn></dt>
                                <dd> boolean. Whether the tab should become the active tab in the window. Does not affect whether the window is focused. Defaults to true.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabCreateDetails">index</dfn></dt>
                                <dd> integer. The position the tab should take in the window. The provided value will be clamped to between zero and the number of tabs in the window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabCreateDetails">openerTabId</dfn></dt>
                                <dd> integer. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as the newly created tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabCreateDetails">pinned</dfn></dt>
                                <dd> boolean. Whether the tab should be pinned. Defaults to false.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabCreateDetails">url</dfn></dt>
                                <dd> string. The URL to navigate the tab to initially. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabCreateDetails">windowId</dfn></dt>
                                <dd> integer. The window to create the new tab in. Defaults to the current window.</dd>

                                <dt> <dfn>BrowserExtTabScriptAndCSSDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.executeScript()</code> and <code>tab.insertCSS()</code> methods.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabScriptAndCSSDetails">allFrames</dfn></dt>
                                <dd> boolean. If true, the code will be injected into all frames of the current page. If true and frameId is set, then the code will be injected into the specified frame and all its child frames. If it is false, code is only injected into the top frame. Defaults to false.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabScriptAndCSSDetails">code</dfn></dt>
                                <dd> string. Code to inject, as a text string.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabScriptAndCSSDetails">file</dfn></dt>
                                <dd> string. Path to a file containing the code to inject. To work cross-browser, specify the path as an absolute URL, starting at the extension's root, like this: "/path/to/script.js".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabScriptAndCSSDetails">frameId</dfn></dt>
                                <dd> integer. The frame where the code should be injected. Defaults to 0&nbsp;(the top-level frame).</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabScriptAndCSSDetails">matchAboutBlank</dfn></dt>
                                <dd> boolean. If true, the code will be injected into blank frames. Defaults to false.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabScriptAndCSSDetails">runAt</dfn></dt>
                                <dd> The soonest that the code will be injected into the tab. Defaults to "document_idle".</dd>

                                <dt> <dfn>BrowserExtTabsCaptureVisibleTabDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.captureVisibleTab()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsCaptureVisibleTabDetails">imageCaptureFormat</dfn></dt>
                                <dd> The format of the resulting image. Default is "jpeg".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsCaptureVisibleTabDetails">jpegQuality</dfn></dt>
                                <dd> integer. When format is "jpeg", this controls the quality of the resulting image. It is a number between 0 and 100. If is is omitted, 92 is used. As quality is decreased, the resulting image will have more visual artifacts, and the number of bytes needed to store it will decrease. This value is ignored for PNG images.</dd>

                                <dt> <dfn>BrowserExtTabQueryDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.query()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">active</dfn></dt>
                                <dd> boolean. Whether the tabs are active in their windows.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">audible</dfn></dt>
                                <dd> boolean. Whether the tabs are audible.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">currentWindow</dfn></dt>
                                <dd> boolean. Whether the tabs are in the current window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">highlighted</dfn></dt>
                                <dd> boolean. Whether the tabs are highlighted.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">index</dfn></dt>
                                <dd> integer. The position of the tabs within their windows.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">lastFocusedWindow</dfn></dt>
                                <dd> boolean. Whether the tabs are in the last focused window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">muted</dfn></dt>
                                <dd> boolean. Whether the tabs are muted.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">pinned</dfn></dt>
                                <dd> boolean. Whether the tabs are pinned.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">status</dfn></dt>
                                <dd> Whether the tabs have completed loading.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">title</dfn></dt>
                                <dd> string. Match page titles against a pattern.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">url</dfn></dt>
                                <dd> string or array of string. Match tabs against one or more match patterns. Note that fragment identifiers are not matched.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">windowId</dfn></dt>
                                <dd> integer. The ID of the parent window, or <code>windows.WINDOW_ID_CURRENT</code> for the current window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabQueryDetails">windowType</dfn></dt>
                                <dd> The type of window the tabs are in.</dd>

                                <dt> <dfn>BrowserExtTabReloadDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.reload()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabReloadDetails">bypassCache</dfn></dt>
                                <dd> boolean. Bypass the local web cache. Default is false.</dd>

                                <dt> <dfn>BrowserExtTabSendMessageDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.sendMessage()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabSendMessageDetails">frameId</dfn></dt>
                                <dd> integer. Sends the message to a specific frame identified by frameId instead of all frames in the tab.</dd>

                                <dt> <dfn>BrowserExtTabUpdateDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.update()</code> method.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabUpdateDetails">active</dfn></dt>
                                <dd> boolean. Whether the tab should be active. Does not affect whether the window is focused </dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabUpdateDetails">highlighted</dfn></dt>
                                <dd> boolean. Adds or removes the tab from the current selection.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabUpdateDetails">muted</dfn></dt>
                                <dd> boolean. Whether the tab should be muted.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabUpdateDetails">openerTabId</dfn></dt>
                                <dd> integer. The ID of the tab that opened this tab. If specified, the opener tab must be in the same window as this tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabUpdateDetails">pinned</dfn></dt>
                                <dd> boolean. Whether the tab should be pinned.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabUpdateDetails">url</dfn></dt>
                                <dd> string. A URL to navigate the tab to.&nbsp;</dd>

                                <dt> <dfn>BrowserExtTabIdWindowId</dfn></dt>
                                <dd> Information provided to the <code>tabs.onActivated()</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabIdWindowId">tabId</dfn></dt>
                                <dd> integer. The ID of the tab that has become active.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabIdWindowId">windowId</dfn></dt>
                                <dd> integer. The ID of the tab's window.</dd>

                                <dt> <dfn>BrowserExtTabsWindowIdIsWindowClosing</dfn></dt>
                                <dd> Information provided to the <code>tabs.onRemoved()</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsWindowIdIsWindowClosing">isWindowClosing</dfn></dt>
                                <dd> boolean. true if the tab is being closed because its window is being closed.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsWindowIdIsWindowClosing">windowId</dfn></dt>
                                <dd> integer. The window whose tab is closed.</dd>

                                <dt> <dfn>BrowserExtTabsOnUpdatedChangeDetails</dfn></dt>
                                <dd> Information provided to the <code>tabs.onUpdated()</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">audible</dfn></dt>
                                <dd> boolean. The tab's new audible state.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">favIconUrl</dfn></dt>
                                <dd> string. The tab's new favicon URL.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">mutedDetails</dfn></dt>
                                <dd> The tab's new muted state and the reason for the change.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">pinned</dfn></dt>
                                <dd> boolean. The tab's new pinned state.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">status</dfn></dt>
                                <dd> string. The status of the tab. Can be either loading or complete.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">title</dfn></dt>
                                <dd> string. The page's title text string.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsOnUpdatedChangeDetails">url</dfn></dt>
                                <dd> string. The tab's URL if it has changed.</dd>

                                <dt> <dfn>BrowserExtTabsOnActivatedCallback</dfn></dt>
                                <dd> Callback for the <code>tabs.onActivated()</code> event.</dd>
                                <dt> <dfn>BrowserExtTabsOnCreatedCallback</dfn></dt>
                                <dd> Callback for the <code>tabs.onCreated()</code> event.</dd>
                                <dt> <dfn>BrowserExtTabsOnRemovedCallback</dfn></dt>
                                <dd> Callback for the <code>tabs.onRemoved()</code> event.</dd>
                                <dt> <dfn>BrowserExtTabsOnUpdatedCallback</dfn></dt>
                                <dd> Callback for the <code>tabs.onUpdated()</code> event.</dd>

                                <dt> <dfn>BrowserExtBrowserTabs</dfn></dt>
                                <dd>  The definition for the <code>browser.tabs</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">captureVisibleTab</dfn></dt>
                                <dd> Creates a data URI encoding an image of the visible area of the currently active tab in the specified window. You must have the &lt;all_urls&gt; permission to use this method. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">connect</dfn></dt>
                                <dd> Call this function to set up a connection between the extension's background scripts (or other privileged scripts, such as popup scripts or options page scripts) and any content scripts that belong to this extension and are running in the specified tab. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">create</dfn></dt>
                                <dd> Creates a new tab. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">executeScript</dfn></dt>
                                <dd> Injects JavaScript code into a page. To use this API you must have the permission for the page's URL, either explicitly as a host permission, or using the activeTab permission.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">get</dfn></dt>
                                <dd> Given a tab ID, get the tab's details as a <code>tabs.Tab</code> object. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs" data-lt="getCurrent()">getCurrent</dfn></dt>
                                <dd> Get&nbsp;a <code>tabs.Tab</code> containing information about the tab that this script is running in. You can call this function in contexts where there is a browser tab, such as an options page. If you call it from a background script or a popup, it will return undefined. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">insertCSS</dfn></dt>
                                <dd> Injects CSS into a page. To use this API you must have the permission for the page's URL, either explicitly as a host permission, or using the activeTab permission. You can only inject CSS into pages whose URL can be expressed using a match pattern: meaning, its scheme must be one of "http", "https", "file", "ftp". The inserted CSS may be removed again by calling tabs.removeCSS().This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">onActivated</dfn></dt>
                                <dd> Fires when the active tab in a window changes. Note that the tab's URL may not be set at the time this event fired, but you can listen to <code>tabs.onUpdated</code> events to be notified when a URL is set.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">onCreated</dfn></dt>
                                <dd> Fired when a tab is created. Note that the tab's URL may not be given its final value at the time this event fired. Browsers may create a new tab with a temporary URL such as "about:blank" before loading the new page into it. You can listen to <code>tabs.onUpdated</code> events to be notified when a URL is set.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">onRemoved</dfn></dt>
                                <dd> Fired when a tab is closed.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">onUpdated</dfn></dt>
                                <dd> Fired when a tab is updated.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">query</dfn></dt>
                                <dd> Gets all tabs that have the specified properties, or all tabs if no properties are specified. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">reload</dfn></dt>
                                <dd> Reload a tab, optionally bypassing the local web cache. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">remove</dfn></dt>
                                <dd> Closes one or more tabs. This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs" data-lt="sendMessage()">sendMessage</dfn></dt>
                                <dd> Sends a single message from the extension's background scripts (or other privileged scripts, such as popup scripts or options page scripts) and any content scripts that belong to this extension and are running in the specified tab.
The message will be received in the content scripts by any listeners to the runtime.onMessage event. Listeners may then optionally send a response back to the background script using the sendResponse argument.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserTabs">update</dfn></dt>
                                <dd> Navigate the tab to a new URL, or modify other properties of the tab.
To use this function, pass the ID of the tab to update, and an&nbsp;updateProperties object containing the properties you want to update. Properties that are not specified in <code>BrowserExtTabUpdateDetails</code> are not modified.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn>BrowserExtTabsAPI</dfn></dt>
                                <dd>  The interface for the <code>browser.tabs</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTabsAPI">tabs</dfn></dt>
                                <dd>  The <code>browser.tabs</code> object.</dd>
                                </dl>
                            </section>
                        </section>
                    </section>


                <section>
                    <h4 id="webNavigation">The <code>webNavigation</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>webNavigation</code> object is used to monitor events related to networking requests.
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            The <code>"webNavigation"</code> permission is required to use this object.
                        </p>
<pre>{
    "permissions": [                               // Required
        "webNavigation"                            // Required
    ]                                              // Required   
}
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>






<pre class="def idl">enum BrowserExtTransitionType { "link", "typed" };
dictionary BrowserExtWebNavigationOnBeforeNavigateDetails {
    long frameId;
    long parentFrameId;
    long tabId;
    double timeStamp;
    DOMString url;
};
dictionary BrowserExtWebNavigationOnCommittedDetails {
    long frameId;
    long processId;
    long tabId;
    double timeStamp;
    TransitionType transitionType;
    DOMString url;
};
dictionary BrowserExtWebNavigationOnCompletedDetails {
    long frameId;
    long processId;
    long tabId;
    double timeStamp;
    DOMString url;
};
dictionary BrowserExtWebNavigationOnDOMContentLoadedDetails {
    long frameId;
    long processId;
    long tabId;
    double timeStamp;
    DOMString url;
};
dictionary BrowserExtWebNavigationOnErrorOccurredDetails {
    DOMString error;
    long frameId;
    long tabId;
    double timeStamp;
    DOMString url;
};
dictionary BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails {
    long frameId;
    long processId;
    long tabId;
    double timeStamp;                           
    BrowserExtTransitionType transitionType;
    DOMString url;
};
callback BrowserExtWebNavigationOnBeforeNavigateCallback = void (BrowserExtWebNavigationOnBeforeNavigateDetails details);
callback BrowserExtWebNavigationOnCommittedCallback = void (BrowserExtWebNavigationOnCommittedDetails details);
callback BrowserExtWebNavigationOnCompletedCallback = void (BrowserExtWebNavigationOnCompletedDetails details);
callback BrowserExtWebNavigationOnDOMContentLoadedCallback = void (BrowserExtWebNavigationOnDOMContentLoadedDetails details);
callback BrowserExtWebNavigationOnErrorOccurredCallback = void (BrowserExtWebNavigationOnErrorOccurredDetails details);
callback BrowserExtWebNavigationOnReferenceFragmentUpdated = void (BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails details);
[NoInterfaceObject]
interface BrowserExtBrowserWebNavigation {
    void onBeforeNavigate(BrowserExtWebNavigationOnBeforeNavigateCallback callback);
    void onCommitted(BrowserExtWebNavigationOnCommittedCallback callback);
    void onCompleted(BrowserExtWebNavigationOnCompletedCallback callback);
    void onDOMContentLoaded(BrowserExtWebNavigationOnDOMContentLoadedCallback callback);
    void onErrorOccurred(BrowserExtWebNavigationOnErrorOccurredCallback callback);
    void onReferenceFragmentUpdated(BrowserExtWebNavigationOnReferenceFragmentUpdated callback);
};
    
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExtWebNavigation_]
interface BrowserExtWebNavigationAPI {
    readonly attribute BrowserExtWebNavigation webNavigation; 
};
Browser implements BrowserExtWebNavigationAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtTransitionType</dfn></dt>
                                <dd> Cause of the navigation. For example, the user clicked a link or typed an address.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTransitionType">link</dfn></dt>
                                <dd> The user clicked a link in another page.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtTransitionType">typed</dfn></dt>
                                <dd> The user typed the URL into the address bar. This is also used if the user started typing into the address bar, then selected a URL from the suggestions it offered.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnBeforeNavigateDetails</dfn></dt>
                                <dd> Information provided to the <code>webNavigation.onBeforeNavigate</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnBeforeNavigateDetails">frameId</dfn></dt>
                                <dd> integer. Frame in which the navigation is about to occur. 0 indicates that navigation happens in the tab's top-level browsing context, not in a nested iframe. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnBeforeNavigateDetails">parentFrameId</dfn></dt>
                                <dd> integer. ID of this frame's parent. Set to -1 if this is a top-level frame.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnBeforeNavigateDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the navigation is about to occur.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnBeforeNavigateDetails">timeStamp</dfn></dt>
                                <dd> number. The time when the browser is about to start the navigation, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnBeforeNavigateDetails">url</dfn></dt>
                                <dd> string. The URL to which the given frame will navigate.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnCommittedDetails</dfn></dt>
                                <dd> Information provided to the <code>webNavigation.onCommitted</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCommittedDetails">frameId</dfn></dt>
                                <dd> integer. Frame in which the navigation will occur. 0 indicates that navigation happens in the tab's top-level browsing context, not in a nested iframe. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCommittedDetails">processId</dfn></dt>
                                <dd> integer. The ID of the process in which this tab is being rendered.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCommittedDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the navigation is about to occur.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCommittedDetails">timeStamp</dfn></dt>
                                <dd> number. The time that the navigation was committed, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCommittedDetails">transitionType</dfn></dt>
                                <dd> The reason for the navigation: for example, "link" if the user clicked a link, or "reload" if the user reloaded the page.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCommittedDetails">url</dfn></dt>
                                <dd> string. The URL to which the given frame will navigate.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnCompletedDetails</dfn></dt>
                                <dd> Information provided to the <code>webNavigation.onCompleted</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCompletedDetails">frameId</dfn></dt>
                                <dd> integer. Frame in which the navigation has occurred. 0 indicates that navigation happened in the tab's top-level browsing context, not in a nested iframe. A positive value indicates that navigation happened in a nested iframe. Frame IDs are unique for a given tab and process.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCompletedDetails">processId</dfn></dt>
                                <dd> integer. The ID of the process in which this tab is being rendered.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCompletedDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the navigation has occurred.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCompletedDetails">timeStamp</dfn></dt>
                                <dd> number. The time at which the page finished loading, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnCompletedDetails">url</dfn></dt>
                                <dd> string. The URL to which the given frame has navigated.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnDOMContentLoadedDetails</dfn></dt>
                                <dd> Information provided to the <code>webNavigation.onDOMContentLoaded</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnDOMContentLoadedDetails">frameId</dfn></dt>
                                <dd> integer. Frame in which the navigation is occurring. 0 indicates that navigation happens in the tab's top-level browsing context, not in a nested iframe. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnDOMContentLoadedDetails">processId</dfn></dt>
                                <dd> integer. The ID of the process in which this tab is being rendered.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnDOMContentLoadedDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the navigation has occurred.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnDOMContentLoadedDetails">timeStamp</dfn></dt>
                                <dd> number. The time at which DOMContentLoaded was fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnDOMContentLoadedDetails">url</dfn></dt>
                                <dd> string. The URL to which the given frame has navigated.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnErrorOccurredDetails</dfn></dt>
                                <dd> Information provided to the <code>webNavigation.onErrorOccurred</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnErrorOccurredDetails">error</dfn></dt>
                                <dd>  string. The error code. This is an internal error code, and is not guaranteed to stay the same or be consistent from one browser to another.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnErrorOccurredDetails">frameId</dfn></dt>
                               <dd> integer. Frame in which the navigation is occurring. 0 indicates that navigation happens in the tab's top-level browsing context, not in a nested iframe. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnErrorOccurredDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the navigation has occurred.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnErrorOccurredDetails">timeStamp</dfn></dt>
                                <dd> number. The time at which DOMContentLoaded was fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnErrorOccurredDetails">url</dfn></dt>
                                <dd> string. The URL to which the given frame has navigated.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails</dfn></dt>
                                <dd> Information provided to the <code>webNavigation.onReferenceFragmentUpdated</code> callback.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails">frameId</dfn></dt>
                                <dd> integer. Frame in which the navigation will occur. 0 indicates that navigation happens in the tab's top-level browsing context, not in a nested iframe. A positive value indicates that navigation happens in a nested iframe. Frame IDs are unique for a given tab and process.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails">processId</dfn></dt>
                                <dd> integer. The ID of the process in which this tab is being rendered.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the navigation is about to occur.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails">timeStamp</dfn></dt>
                                <dd> number. The time that the navigation was committed, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails">transitionType</dfn></dt>
                                <dd> transitionType. The reason for the navigation: for example, "link" if the user clicked a link</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationOnReferenceFragmentUpdatedDetails">url</dfn></dt>
                                <dd> string. The URL to which the given frame will navigate.</dd>

                                <dt> <dfn>BrowserExtWebNavigationOnBeforeNavigateCallback</dfn></dt>
                                <dd> The <code>webNavigation.onBeforeNavigate</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebNavigationOnCommittedCallback</dfn></dt>
                                <dd> The <code>webNavigation.onCommittedCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebNavigationOnCompletedCallback</dfn></dt>
                                <dd> The <code>webNavigation.onCompletedCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebNavigationOnDOMContentLoadedCallback</dfn></dt>
                                <dd> The <code>webNavigation.onDOMContentLoadedCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebNavigationOnErrorOccurredCallback</dfn></dt>
                                <dd> The <code>webNavigation.onErrorOccurredCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebNavigationOnReferenceFragmentUpdated</dfn></dt>
                                <dd> The <code>webNavigation.onReferenceFragmentUpdated</code> callback.</dd>

                                <dt> <dfn>BrowserExtBrowserWebNavigation</dfn></dt>
                                <dd> The definition for the <code>browser.webNavigation</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebNavigation">onBeforeNavigate</dfn></dt>
                                <dd>Fired when the browser is about to start a navigation event.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebNavigation">onCommitted</dfn></dt>
                                <dd> Fired when a navigation is committed. At least part of the new document has been received from the server and the browser has decided to switch to the new document.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebNavigation" data-lt="onCompleted()">onCompleted</dfn></dt>
                                <dd> Fired when a document, including the resources it refers to, is completely loaded and initialized. This is equivalent to the DOM load event.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebNavigation">onDOMContentLoaded</dfn></dt>
                                <dd> Fired when the <code>DOMContentLoaded</code> event is fired in the page. At this point the document is loaded and parsed, and the DOM is fully constructed, but linked resources such as images, stylesheets and subframes may not yet be loaded.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebNavigation">onErrorOccurred</dfn></dt>
                                <dd> Fired when an error occurs and the navigation is aborted. This can happen if either a network error occurred, or the user aborted the navigation.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebNavigation">onReferenceFragmentUpdated</dfn></dt>
                                <dd>Fired if the fragment identifier for a page is changed. For example, if a page implements a table of contents using fragments, and the user clicks an entry in the table of contents, this event will fire. All future events for this frame will use the updated URL.<p></p>
                                </dd><dt> <dfn>BrowserExtWebNavigationAPI</dfn></dt>
                                <dd> The interface for the <code>browser.webNavigation</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebNavigationAPI">webNavigation</dfn></dt>
                                <dd> The <code>browser.webNavigation</code> object.</dd>
                                </dl>
                            </section>
                        </section>
                    </section>


                <section>
                    <h4 id="webRequest">The <code>webRequest</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>webRequest</code> object is used to modify or cancel networking requests.
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            The <code>"webRequest"</code> permission is required to use this object.
                        </p>
<pre>{
    "permissions": [                           // Required
        "webRequest"                            // Required
        "webRequestBlocking"                    // Optional
        "&lt;URL pattern&gt;"                         // Optional, e.g. "*://*.w3.org/"
    ]                                          // Required   
}
</pre>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>




<pre class="def idl">enum BrowserExtResourceType { "font", "image", "main_frame", "object", "other", "ping", "script", "stylesheet", "sub_frame", "xmlhttprequest" };
dictionary BrowserExtWebRequestUploadDetails {
    any bytes;
    DOMString? file;
};
dictionary BrowserExtWebRequestRequestBody {
    DOMString? error;
    object? formData;
    sequence&lt;BrowserExtWebRequestUploadData&gt;? rawData;
};
dictionary BrowserExtWebRequestHttpHeader {
    DOMString keyName;
    any value;
};
dictionary BrowserExtWebRequestHttpHeaders {
    sequence&lt;BrowserExtWebRequestHttpHeader&gt; data; 
};
dictionary BrowserExtWebRequestOnBeforeRequestDetails {
    long frameId;
    DOMString method;
    long parentFrameId;
    BrowserExtWebRequestRequestBody? requestBody;
    DOMString requestId;
    long tabId;
    double timeStamp;
    BrowserExtResourceType type;
    DOMString url;
};
dictionary BrowserExtWebRequestOnBeforeSendHeadersDetails {
    long frameId;
    DOMString method;
    long parentFrameId;
    BrowserExtWebRequestHttpHeaders? requestHeaders;
    DOMString requestId;
    long tabId;
    double timeStamp;
    BrowserExtResourceType type;
    DOMString url;
};
dictionary BrowserExtWebRequestOnCompletedDetails {
    long frameId;
    boolean fromCache;
    DOMString method;
    long parentFrameId;
    DOMString requestId;
    BrowserExtWebRequestHttpHeaders? responseHeaders;
    DOMString? serverIP;
    long statusCode;
    DOMString statusLine;
    long tabId;
    double timeStamp;   
    BrowserExtResourceType type;
    DOMString url;
}; 
dictionary BrowserExtWebRequestOnHeadersReceivedDetails {
    long frameId;
    DOMString method;
    long parentFrameId;
    DOMString requestId;
    BrowserExtWebRequestHttpHeaders? responseHeaders;
    long statusCode;
    DOMString statusLine;
    long tabId;
    double timeStamp;   
    BrowserExtResourceType type;
    DOMString url;
};
dictionary BrowserExtWebRequestOnSendHeadersDetails {
    long frameId;
    DOMString method;
    long parentFrameId;
    BrowserExtWebRequestHttpHeaders? requestHeaders;
    DOMString requestId;
    long tabId;
    double timeStamp;   
    BrowserExtResourceType type;
    DOMString url;
};
callback BrowserExtWebRequestOnBeforeRequestCallback = void (BrowserExtWebRequestOnBeforeRequestDetails details);
callback BrowserExtWebRequestOnBeforeSendHeadersCallback = void (BrowserExtWebRequestOnBeforeSendHeadersDetails details);
callback BrowserExtWebRequestOnCompletedCallback = void (BrowserExtWebRequestOnCompletedDetails details);
callback BrowserExtWebRequestOnHeadersReceivedCallback = void (BrowserExtWebRequestOnHeadersReceivedDetails details);
callback BrowserExtWebRequestOnSendHeadersCallback = void (BrowserExtWebRequestOnSendHeadersDetails details);
[NoInterfaceObject]
interface BrowserExtBrowserWebRequest {
    void onBeforeRequest(BrowserExtWebRequestOnBeforeRequestCallback callback);
    void onBeforeSendHeaders(BrowserExtWebRequestOnBeforeSendHeadersCallback callback);
    void onCompleted(BrowserExtWebRequestOnCompletedCallback callback);
    void onHeadersReceived(BrowserExtWebRequestOnHeadersReceivedCallback callback);
    void onSendHeaders(Function callback);
};
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExtWebRequest_]
interface BrowserExtWebRequestAPI {
    readonly attribute BrowserExtWebRequest webRequest; 
};
Browser implements BrowserWebRequestAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>

                                <dt> <dfn>BrowserExtResourceType</dfn></dt>
                                <dd>This type is a string, which represents a particular kind of resource fetched in a web request. It's used to filter the requests you listen to using the webRequest API. For example: you can listen to requests only for images, or only for scripts.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">font</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for font requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">image</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for image requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">main_frame</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for main frame requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">object</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for object requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">other</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for requests of a type not declared here.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">ping</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for ping requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">script</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for script requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">stylesheet</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for stylesheet requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">sub_frame</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for subframe requests.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtResourceType">xmlhttprequest</dfn></dt>
                                <dd> Fire <code>browser.webRequest</code> events for xmlhttprequest requests.</dd>

                                <dt> <dfn>BrowserExtWebRequestUploadDetails</dfn></dt>
                                <dd> Contains data uploaded in a URL request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestUploadDetails">bytes</dfn></dt>
                                <dd> any. An ArrayBuffer with a copy of the data.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestUploadDetails">file</dfn></dt>
                                <dd>string. A string with the file's path and name</dd>

                                <dt> <dfn>BrowserExtWebRequestRequestBody</dfn></dt>
                                <dd> object. Contains the HTTP request body data.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestRequestBody">error</dfn></dt>
                                <dd> string. This is set if any errors were encountered when obtaining request body data.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestRequestBody">formData</dfn></dt>
                                <dd> object. This object is present if the request method is POST and the body is a sequence of key-value pairs encoded in UTF-8 as either "multipart/form-data" or "application/x-www-form-urlencoded".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestRequestBody">rawData</dfn></dt>
                                <dd> array of webRequest.UploadData. If the request method is PUT or POST, and the body is not already parsed in formData, then this array contains the unparsed request body elements.</dd>

                                <dt> <dfn>BrowserExtWebRequestHttpHeader</dfn></dt>
                                <dd>Each header is represented as an object with two properties: name and value.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestHttpHeader">keyName</dfn></dt>
                                <dd> string. Name of the HTTP header.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestHttpHeader">value</dfn></dt>
                                <dd> string. Value of the HTTP header if it can be represented by UTF-8. </dd>

                                <dt> <dfn>BrowserExtWebRequestHttpHeaders</dfn></dt>
                                <dd> An array of HTTP headers. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestHttpHeaders">data</dfn></dt>
                                <dd> The HTTP header data.</dd>

                                <dt> <dfn>BrowserExtWebRequestOnBeforeRequestDetails</dfn></dt>
                                <dd> Information about the request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">frameId</dfn></dt>
                                <dd> integer. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">method</dfn></dt>
                                <dd> string. Standard HTTP method: for example, "GET" or "POST".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">parentFrameId</dfn></dt>
                                <dd> integer. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">requestBody</dfn></dt>
                                <dd> Contains the HTTP request body data.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">requestId</dfn></dt>
                                <dd> string. The ID of the request. Request IDs are unique within a browser session, so you can use them to relate different events associated with the same request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">tabId</dfn></dt>
                                <dd> integer. ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">timeStamp</dfn></dt>
                                <dd> number. The time when this event fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">type</dfn></dt>
                                <dd> The type of resource being requested: for example, "image", "script", "stylesheet".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeRequestDetails">url</dfn></dt>
                                <dd> string. URL of the resource that triggered this request. Note that this may not be the same as the URL of the page into which the requested resource will be loaded. For example, if a document triggers a load in a different window through the target attribute of a link, or a CSS document includes an image using the url() functional notation, then this will be the URL of the original document or of the CSS document, respectively.</dd>

                                <dt> <dfn>BrowserExtWebRequestOnBeforeSendHeadersDetails</dfn></dt>
                                <dd> Information about the request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">frameId</dfn></dt>
                                <dd> integer. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">method</dfn></dt>
                                <dd> string. Standard HTTP method: for example, "GET" or "POST".e</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">parentFrameId</dfn></dt>
                                <dd> integer. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">requestHeaders</dfn></dt>
                                <dd> The HTTP request headers that will be sent with this request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">requestId</dfn></dt>
                                <dd> string. The ID of the request. Request IDs are unique within a browser session, so you can use them to relate different events associated with the same request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">tabId</dfn></dt>
                                <dd> integer. ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">timeStamp</dfn></dt>
                                <dd> number. The time when this event fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">type</dfn></dt>
                                <dd> The type of resource being requested: for example, "image", "script", "stylesheet".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnBeforeSendHeadersDetails">url</dfn></dt>
                                <dd> string. Target of the request.</dd>

                                <dt> <dfn>BrowserExtWebRequestOnCompletedDetails</dfn></dt>
                                <dd> Information about the request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">frameId</dfn></dt>
                                <dd> integer. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">fromCache</dfn></dt>
                                <dd> boolean. Indicates if this response was fetched from disk cache.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">method</dfn></dt>
                                <dd> string. Standard HTTP method: for example, "GET" or "POST".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">parentFrameId</dfn></dt>
                                <dd> integer. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">requestId</dfn></dt>
                                <dd> string. The ID of the request. Request IDs are unique within a browser session, so you can use them to relate different events associated with the same request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">responseHeaders</dfn></dt>
                                <dd> The HTTP response headers that were received along with this response.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">serverIP</dfn></dt>
                                <dd> The server IP address that the request was actually sent to. Note that it may be a literal IPv6 address.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">statusCode</dfn></dt>
                                <dd> integer. Standard HTTP status code returned by the server.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">statusLine</dfn></dt>
                                <dd> string. HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (i.e., responses that lack a status line) or an empty string if there are no headers.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">timeStamp</dfn></dt>
                                <dd> number. The time when this event fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">type</dfn></dt>
                                <dd> The type of resource being requested: for example, "image", "script", "stylesheet".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnCompletedDetails">url</dfn></dt>
                                <dd> string. Target of the request.</dd>

                                <dt> <dfn>BrowserExtWebRequestOnHeadersReceivedDetails</dfn></dt>
                                <dd> Information about the request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">frameId</dfn></dt>
                                <dd> integer. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">method</dfn></dt>
                                <dd> string. Standard HTTP method: for example, "GET" or "POST".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">parentFrameId</dfn></dt>
                                <dd> integer. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">requestId</dfn></dt>
                                <dd> string. The ID of the request. Request IDs are unique within a browser session, so you can use them to relate different events associated with the same request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">responseHeaders</dfn></dt>
                                <dd> The HTTP response headers that were received for this request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">statusCode</dfn></dt>
                                <dd> integer. Standard HTTP status code returned by the server.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">statusLine</dfn></dt>
                                <dd> string. HTTP status line of the response or the 'HTTP/0.9 200 OK' string for HTTP/0.9 responses (that is, responses that lack a status line).</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">tabId</dfn></dt>
                                <dd> integer. ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">timeStamp</dfn></dt>
                                <dd> number. The time when this event fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">type</dfn></dt>
                                <dd> The type of resource being requested: for example, "image", "script", "stylesheet".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnHeadersReceivedDetails">url</dfn></dt>
                                <dd> string. Target of the request.</dd>

                                <dt> <dfn>BrowserExtWebRequestOnSendHeadersDetails</dfn></dt>
                                <dd> Information about the request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">frameId</dfn></dt>
                                <dd> integer. Zero if the request happens in the main frame; a positive value is the ID of a subframe in which the request happens. If the document of a (sub-)frame is loaded (type is main_frame or sub_frame), frameId indicates the ID of this frame, not the ID of the outer frame. Frame IDs are unique within a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">method</dfn></dt>
                                <dd> string. Standard HTTP method: for example, "GET" or "POST".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">parentFrameId</dfn></dt>
                                <dd> integer. ID of the frame that contains the frame which sent the request. Set to -1 if no parent frame exists.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">requestHeaders</dfn></dt>
                                <dd> The HTTP request headers that have been sent out with this request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">requestId</dfn></dt>
                                <dd> string. The ID of the request. Request IDs are unique within a browser session, so you can use them to relate different events associated with the same request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">tabId</dfn></dt>
                                <dd> integer. ID of the tab in which the request takes place. Set to -1 if the request isn't related to a tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">timeStamp</dfn></dt>
                                <dd> number. The time when this event fired, in milliseconds since the epoch.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">type</dfn></dt>
                                <dd> The type of resource being requested: for example, "image", "script", "stylesheet".</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestOnSendHeadersDetails">url</dfn></dt>
                                <dd> URL of the resource that triggered this request. Note that this may not be the same as the URL of the page into which the requested resource will be loaded. For example, if a document triggers a load in a different window through the target attribute of a link, or a CSS document includes an image using the url() functional notation, then this will be the URL of the original document or of the CSS document, respectively.</dd>
                                <dt> <dfn>BrowserExtWebRequestOnBeforeRequestCallback</dfn></dt>
                                <dd> The <code>webRequest.onBeforeRequestCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebRequestOnBeforeSendHeadersCallback</dfn></dt>
                                <dd> The <code>webRequest.onBeforeSendHeadersCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebRequestOnCompletedCallback</dfn></dt>
                                <dd> The <code>webRequest.onCompletedCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebRequestOnHeadersReceivedCallback</dfn></dt>
                                <dd> The <code>webRequest.onHeadersReceivedCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtWebRequestOnSendHeadersCallback</dfn></dt>
                                <dd> The <code>webRequest.onSendHeadersCallback</code> callback.</dd>
                                <dt> <dfn>BrowserExtBrowserWebRequest</dfn></dt>
                                <dd> The description for the <code>browser.webRequest</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebRequest">onBeforeRequest</dfn></dt>
                                <dd> This event is triggered when a request is about to be made, and before headers are available. This is a good place to listen if you want to cancel or redirect the request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebRequest">onBeforeSendHeaders</dfn></dt>
                                <dd> This event is triggered before sending any HTTP data, but after all HTTP headers are available. This is a good place to listen if you want to modify HTTP request headers.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebRequest" data-lt="onCompleted()">onCompleted</dfn></dt>
                                <dd> Fired when a request has completed.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebRequest">onHeadersReceived</dfn></dt>
                                <dd> Fired when the HTTP response headers associated with a request have been received. You can use this event to modify HTTP response headers.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtBrowserWebRequest">onSendHeaders</dfn></dt>
                                <dd> This event is fired just before sending headers. If your extension or some other extension modified headers in onBeforeSendHeaders, you'll see the modified version here.</dd>
                                <dt> <dfn>BrowserExtWebRequestAPI</dfn></dt>
                                <dd> The interface for the <code>browser.webRequest</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWebRequestAPI">webRequest</dfn></dt>
                                <dd> The <code>browser.webRequest</code> object.</dd>
                                </dl>
                            </section>
                        </section>
                    </section>

                <section>
                    <h4 id="windows">The <code>windows</code> object</h4>
                    <section class="introductory">
                        <h4>Overview</h4>
                        <p>
                            The <code>windows</code> object is used to access the UI windows managed by the browser.
                        </p>
                    </section><section class="introductory">
                        <h4>Manifest</h4>
                        <p>
                            There are no additional manifest entries required for an extension to use this object.
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>Context</h4>
                        <p>
                            This API is available in Window context (background, event, popup, options and custom pages).
                        </p>
                    </section>
                    <section class="introductory">
                        <h4>WebIDL Definition</h4>
                        <p>
                            A description of the special <a href="https://browserext.github.io/browserext/#web-idl">WebIDL syntax considerations</a> for browser extensions are defined elsewhere in this document.
                        </p>

<pre class="def idl">enum BrowserExtWindowsWindowType { "detached_panel", "normal", "panel", "popup" };
enum BrowserExtWindowsWindowState { "docked", "fullscreen", "maximized", "minimized", "normal" };
dictionary BrowserExtCreateWindowDetails {
    boolean focused;
    long height;
    boolean incognito;
    long left;
    BrowserExtWindowsWindowState? state;
    long tabId;
    long top;
    (DOMString? or sequence&lt;DOMString&gt;?) url;
    long width;
    BrowserExtWindowsWindowType? windowType;
};
dictionary BrowserExtGetWindowDetails {
    boolean populate;
    sequence&lt;BrowserExtWindowsWindowType&gt;? windowTypes;
};
dictionary BrowserExtWindowUpdateDetails {
    boolean drawAttention;
    boolean focused;
    long height;
    long left;
    long top;
    long width;
    BrowserExtWindowState? windowState;
};
dictionary BrowserExtWindowsWindow {
    boolean alwaysOnTop;
    boolean focused;
    long height;
    long id;
    boolean incognito;
    long left;
    sequence&lt;BrowserExtTabsTab&gt;? tabs;
    long top;
    DOMString? sessionId;
    BrowserExtWindowsWindowState? state;
    long width;
    BrowserExtWindowsWindowType? windowType;
};
callback BrowserExtWindowsOnFocusChangedCallback = void (long windowId);
[NoInterfaceObject]
interface BrowserExtWindows {
    Promise&lt;BrowserExtWindowsWindow&gt; create(CreateWindowDetails details);
    Promise&lt;BrowserExtWindowsWindow&gt; get(long windowId, optional BrowserExtGetWindowDetails details);
    Promise&lt;sequence&lt;BrowserExtWindowsWindow&gt;&gt; getAll(optional BrowserExtGetWindowDetail details);
    Promise&lt;BrowserExtWindowsWindow&gt; getCurrent(optional BrowserExtGetWindowDetail details);
    Promise&lt;BrowserExtWindowsWindow&gt; getLastFocused(optional BrowserExtGetWindowDetail details);
    void onFocusChanged(BrowserExtWindowsOnFocusChangedCallback callback);
    Promise&lt;BrowserExtWindowsWindow&gt; update(long windowId, optional BrowserExtWindowUpdateDetails details);
};
    
[NoInterfaceObject, Exposed=Window, CheckAnyPermissions_browserExt_]
interface BrowserExtWindowsAPI {
readonly attribute BrowserExtWindows windows; 
};
Browser implements BrowserExtWindowsAPI;
</pre>
                        <section class="introductory">
                            <h4> Definitions</h4>
                            <dl>
                                <dt> <dfn>BrowserExtWindowsWindowType</dfn></dt>
                                <dd> The type of browser window this is.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowType">detached_panel</dfn></dt>
                                <dd> The browser window is a detached panel.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowType">normal</dfn></dt>
                                <dd> The browser window is a normal window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowType">panel</dfn></dt>
                                <dd> The browser window is a panel.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowType">popup</dfn></dt>
                                <dd> The browser window is a popup.</dd>
                                <dt> <dfn>BrowserExtWindowsWindowState</dfn></dt>
                                <dd> The state of this browser window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowState">docked</dfn></dt>
                                <dd> The window is docked.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowState">fullscreen</dfn></dt>
                                <dd> The window is full screen.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowState">maximized</dfn></dt>
                                <dd> The window is maximized.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowState">minimized</dfn></dt>
                                <dd> The window is minimized.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindowState">normal</dfn></dt>
                                <dd> The window is normal.</dd>

                                <dt> <dfn>BrowserExtCreateWindowDetails</dfn></dt>
                                <dd> Information about a browser window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">focused</dfn></dt>
                                <dd> boolean. Whether the window is currently the focused window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">height</dfn></dt>
                                <dd> integer. The height of the window, including the frame, in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">incognito</dfn></dt>
                                <dd> boolean. Whether the window is incognito.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">left</dfn></dt>
                                <dd> integer. The offset of the window from the left edge of the screen in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">state</dfn></dt>
                                <dd>  Represents the state of this browser window — maximized, minimized, etc.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">tabId</dfn></dt>
                                <dd> integer. The ID of the tab.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">top</dfn></dt>
                                <dd> integer. The offset of the window from the top edge of the screen in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">url</dfn></dt>
                                <dd> string or array of strings. A URL or array of URLs to open as tabs in the window. Fully-qualified URLs must include a scheme. Relative URLs will be relative to the current page within the extension. </dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">width</dfn></dt>
                                <dd> integer. The width of the window, including the frame, in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtCreateWindowDetails">windowType</dfn></dt>
                                <dd> Represents the type of browser window — normal browser window, popup, etc.</dd>

                                <dt> <dfn>BrowserExtGetWindowDetails</dfn></dt>
                                <dd> Details about a window, given its ID.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtGetWindowDetails">populate</dfn></dt>
                                <dd>boolean. If true, the <code>windows.Window</code> object will have a tabs property that contains a list of <code>tabs.Tab</code> objects representing the tabs open in the window. The Tab objects only contain the url, title and favIconUrl properties if the extension's manifest file includes the "tabs" permission.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtGetWindowDetails">windowTypes</dfn></dt>
                                <dd> array of <code>BrowserExtWindowsWindowType</code></dd>

                                <dt> <dfn>BrowserExtWindowUpdateDetails</dfn></dt>
                                <dd> Object containing the properties to update.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">drawAttention</dfn></dt>
                                <dd> boolean. If true, causes the window to be displayed in a manner that draws the user's attention to the window, without changing the focused window. The effect lasts until the user changes focus to the window. This option has no effect if the window already has focus. Set to false to cancel a previous drawAttention request.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">focused</dfn></dt>
                                <dd> boolean. If true, brings the window to the front. If false, brings the next window in the z-order to the front.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">height</dfn></dt>
                                <dd> integer. The height to resize the window to in pixels. This value is ignored for panels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">left</dfn></dt>
                                <dd> integer. The offset from the left edge of the screen to move the window to in pixels. This value is ignored for panels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">top</dfn></dt>
                                <dd> integer. The offset from the top edge of the screen to move the window to in pixels. This value is ignored for panels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">width</dfn></dt>
                                <dd> integer. The width to resize the window to in pixels. This value is ignored for panels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowUpdateDetails">windowState</dfn></dt>
                                <dd> The new state of the window. The minimized, maximized and fullscreen states cannot be combined with left, top, width or height.</dd>

                                <dt> <dfn>BrowserExtWindowsWindow</dfn></dt>
                                <dd> Information about a browser window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">alwaysOnTop</dfn></dt>
                                <dd> boolean. Whether the window is set to be always on top.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">focused</dfn></dt>
                                <dd> boolean. Whether the window is currently the focused window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">height</dfn></dt>
                                <dd> integer. The height of the window, including the frame, in pixels</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">id</dfn></dt>
                                <dd> integer. The ID of the window. Window IDs are unique within a browser session.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">incognito</dfn></dt>
                                <dd> boolean. Whether the window is incognito.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">left</dfn></dt>
                                <dd> integer. The offset of the window from the left edge of the screen in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">tabs</dfn></dt>
                                <dd> Array of <code>tabs.Tab</code> objects representing the current tabs in the window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">top</dfn></dt>
                                <dd> integer. The offset of the window from the top edge of the screen in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">sessionId</dfn></dt>
                                <dd> string. The session ID used to uniquely identify a Window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">state</dfn></dt>
                                <dd> Represents the state of this browser window — maximized, minimized, etc.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">width</dfn></dt>
                                <dd> integer. The width of the window, including the frame, in pixels.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsWindow">windowType</dfn></dt>
                                <dd> Represents the type of browser window this is — normal browser window, popup, etc.</dd>


                                <dt> <dfn>BrowserExtWindowsOnFocusChangedCallback</dfn></dt>
                                <dd> The <code>browser.windows.onFocusChanged</code> callback.</dd>
                                <dt> <dfn>BrowserExtWindows</dfn></dt>
                                <dd> The definition for the <code>browser.windows</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows">create</dfn></dt>
                                <dd> Creates a new window.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows">get</dfn></dt>
                                <dd> Gets details about a window, given its ID. The details are passed into a callback.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows">getAll</dfn></dt>
                                <dd> Gets information about all open windows, passing them into a callback.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows" data-lt="getCurrent()">getCurrent</dfn></dt>
                                <dd> Gets the current window, passing its details into a callback.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows">getLastFocused</dfn></dt>
                                <dd> Gets the window that was most recently focused — typically the window 'on top' — and passes it into a callback.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows">onFocusChanged</dfn></dt>
                                <dd> Fired when the currently focused window changes. Will be <code>windows.WINDOW_ID_NONE</code> if all browser windows have lost focus.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindows">update</dfn></dt>
                                <dd> Updates the properties of a window. Use this to move, resize, and (un)focus a window, etc.
This is an asynchronous function that returns a Promise.</dd>
                                <dt> <dfn>BrowserExtWindowsAPI</dfn></dt>
                                <dd> The interface for the <code>browser.windows</code> object.</dd>
                                <dt> <dfn data-dfn-for="BrowserExtWindowsAPI">windows</dfn></dt>
                                <dd> The <code>browser.windows</code> object.</dd>
                                </dl>
                            </section>
                        </section>
                    </section>
            </section>

        <section class="informative">
            <h3>Native Messaging</h3>
            <p>Native Messaging is covered in another specification. Refer to the Native Messaging for Browser Extensions specification [[browserext-native]] for more information.</p>
        </section>

</section>
    <section>
        <h3>Events</h3>
        <section>
            <h4>Overview</h4>
            <p>
                Extension events are similar to DOM Events [<a href="https://www.w3.org/TR/dom/">DOM4</a>]. However, extension events are dispatched only to objects in the relevant extension scope (background, event, options, content, etc.). Script in the extension scope can observe events by calling <code>addListener()</code>.
            </p>

            <pre class="def idl">[NoInterfaceObject, Exposed=(Window,ContentScript), CheckAnyPermissions_browserExt_]
interface BrowserExtEvent {
    void    addListener(Function callback);
    void    removeListener(Function callback);
    boolean hasListener(Function callback);
    boolean hasListeners();
};
</pre>

            <section class="introductory">
                <h4> Definitions</h4>
                <dl>
                    <dt><dfn>BrowserExtEvent</dfn></dt>
                    <dd> The Event type used by extensions</dd>
                    <dt><dfn data-dfn-for="BrowserExtEvent">addListener</dfn></dt>
                    <dd> Register to be notified when the even fires.</dd>
                    <dt><dfn data-dfn-for="BrowserExtEvent">removeListener</dfn></dt>
                    <dd> Unregister for notifications.</dd>
                    <dt><dfn data-dfn-for="BrowserExtEvent">hasListener</dfn></dt>
                    <dd> Confirms whether a specific listener has been registered.</dd>
                    <dt><dfn data-dfn-for="BrowserExtEvent">hasListeners</dfn></dt>
                    <dd> Confirms whether any listeners have been registered.</dd>
                </dl>
            </section>
        </section>
    </section>
    <section>
        <h2 id="message-strings">Message Strings</h2>
        <section>
            <h4>Overview</h4>
            <p>Message strings are used in the <code>manifest.json</code> file as well <code>browser.i18n.getMessage()</code>. </p>
        </section>
            <section>
                <h4>Predefined messages</h4>
                <p>Predefined messages are accessed in the same way as other messages. The syntax for standard messages is:</p>
                <code>__MSG_extensionName__</code>
                <p>Predefined messages use exactly the same syntax, except with @@ before the message name. For example:</p>
                <code>__MSG_@@ui_locale__</code>
                <p>The following table shows the different available predefined messages:</p>
                <table>
                    <tbody><tr><td><b>Message name</b></td><td><b>Description</b></td></tr>
                    <tr><td>@@extension_id</td><td>The extension or app ID; you might use this string to construct URLs for resources inside the extension. Even unlocalized extensions can use this message. Note that you can't use this message in a manifest file.</td></tr>
                    <tr><td>@@ui_locale</td><td>The current locale; you might use this string to construct locale-specific URLs.</td></tr>
                    <tr><td>@@bidi_dir</td><td>The text direction for the current locale, either "ltr" for left-to-right languages such as English or "rtl" for right-to-left languages such as Arabic.</td></tr>
                    <tr><td>@@bidi_reversed_dir</td><td>If the @@bidi_dir is "ltr", then this is "rtl"; otherwise, it's "ltr".</td></tr>
                    <tr><td>@@bidi_start_edge</td><td>If the @@bidi_dir is "ltr", then this is "left"; otherwise, it's "right".</td></tr>
                    <tr><td>@@bidi_end_edge</td><td>If the @@bidi_dir is "ltr", then this is "right"; otherwise, it's "left".</td></tr>
                </tbody></table>
            </section>
        </section>
    <section>
        <h2 id="manifest-json">Manifest Format</h2>
        <section>
            <h3>Pre-parsing</h3>
            <p>Standards-compliant browsers are expected to ignore "//" comments. Disregarding comments, the manifest.json file format for browser extensions is expected to be fully JSON compliant. Malformed JSON files are not supported.  If manifest keys that are not defined in this specification are specified, other browsers MAY ignore those keys.</p>
        </section>
        <section>
            <h3>List of Keys</h3>
            <p>The full list of supported manifest keys is provided below:</p>
            <table class="simple">
                <tbody><tr><th width="100px">Key</th><th>Required</th><th>Details</th></tr>
                <tr><td width="100px"><code>"name"</code></td><td>Required</td><td>The name of the extension. </td></tr>
                <tr><td><code>"version"</code></td><td>Required</td><td>A string representation of a number</td></tr>
                <tr><td><code>"default_locale"</code></td><td>Required if extension uses locales. Not allowed if extension does not use locales</td><td>See <a href="https://browserext.github.io/browserext/#message-strings">Message Strings</a> and <a href="https://browserext.github.io/browserext/#i18n"><code>browser.i18n</code></a> for more information about the use of locales and localized resources.</td></tr>
                <tr><td><code>"description"</code></td><td>Optional</td><td>Describes the capabilities of the extension.</td></tr>
                <tr><td><code>"icons" : {<br>
&nbsp;&nbsp;&nbsp;"&lt;size&gt;" : "&lt;filename.jpg&gt;"<br>
}</code></td><td>Optional</td><td>A list of pairs of pixel dimensions and JPEG filenames. These are typically used to display visuals for the extension in browser management UI for extensions. Browsers MAY require specific sizes. For example,<br><code>"icons":{<br>&nbsp;&nbsp;&nbsp;"16":"small.jpg",<br>&nbsp;&nbsp;&nbsp;"32":"medium.jpg"<br>}<br></code> would be used for a small JPEG with height of 16 pixels and width of 16 pixels (small.jpg), and a second JPEG 32x32 pixels in size (medium.jpg).</td></tr>
<tr><td><code>"developer": {<br>
&nbsp;&nbsp;&nbsp;"name": "&lt;Company&gt;",<br>
&nbsp;&nbsp;&nbsp;"url": "&lt;Website&gt;"<br>
}</code></td><td>Optional</td><td>Includes subkeys for <code>"name"</code> and <code>"url"</code> that provide information about the entity that authored the extension, typically a company or programmer name. The <code>"url"</code> subkey SHOULD refer to the company/programmer site, not a description of the extension.</td></tr>
                <tr><td><code>"browser_action"</code></td><td>Optional<br><br>Note that some browsers only permit <code>"browser_action"</code> or <code>"page_action"</code>, but not both at the same time<p></p></td><td>See <a href="https://browserext.github.io/browserext/#browserAction">browser.browserAction</a> for more information about the subkeys for <code>"browser_action"</code>.</td></tr>
                <tr><td><code>"page_action"</code></td><td>Optional<br><br>Note that some browsers only permit <code>"browser_action"</code> or <code>"page_action"</code>, but not both at the same time</td><td>See <a href="https://browserext.github.io/browserext/#pageAction">browser.pageAction</a> for more information about the subkeys for <code>"page_action"</code>.</td></tr>
<tr><td><code>"browser_specific_settings":{<br>
&nbsp;&nbsp;&nbsp;&lt;browser_name&gt;": {<br>
&nbsp;&nbsp;&nbsp;"&nbsp;&nbsp;&nbsp;"&lt;key&gt;": "&lt;value&gt;"<br>
&nbsp;&nbsp;&nbsp;}<br>
}</code></td><td>Optional</td><td>Describes specific values that MAY be considered by a browser. For example, a particular extension may require version 42 or greater of the Gecko browser in order to work properly:<br>
<code>"browser_specific_settings":{<br>
&nbsp;&nbsp;&nbsp;"gecko": {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"strict_min_version": "42.0"<br>
&nbsp;&nbsp;&nbsp;}<br>
}</code><br>

                              </td></tr>
<tr><td><code>"background" : {<br>
&nbsp;&nbsp;&nbsp;"page": "&lt;Page URL&gt;",<br>
&nbsp;&nbsp;&nbsp;"scripts": [...],<br>
&nbsp;&nbsp;&nbsp;"persistent": boolean,<br>
}
</code></td><td>Optional<br><br>If <code>"background"</code> is specified, <code>"persistent"</code> is required.<br><br>Other subkeys are optional</td><td>Automatically loads a page or script and begins execution, regardless of the page being viewed in a tab.</td></tr> 

<tr><td><code>"content_scripts" : {<br>
&nbsp;&nbsp;&nbsp;"all_frames": &lt;boolean&gt;,<br>
&nbsp;&nbsp;&nbsp;"css": [...],<br>
&nbsp;&nbsp;&nbsp;"exclude_matches": [...],<br>
&nbsp;&nbsp;&nbsp;"js": [...],<br>
&nbsp;&nbsp;&nbsp;"matches": [...],<br>
&nbsp;&nbsp;&nbsp;"run_at": &lt;see_details&gt;,<br>
}
</code></td><td>Optional</td><td>Automatically adds scripts (from the <code>"js"</code> subkey list) or CSS (from the <code>"css"</code> subkey list) to each page within a tab.<br><br>If <code>all_frames</code> is <code>false</code>, the string patterns from <code>matches</code> and <code>exclude_matches</code> are used accordingly to determine which page content is modified or excluded.<br><br>Valid values for <code>"run_at"</code> are <code>"document_start", "document_end"</code> and <code>"document_idle"</code>.<p></p></td></tr>

<tr><td><code>"content_security_policy"</code></td><td>Optional</td><td>A string representation of the new policy to override the default policy. See <a href="https://browserext.github.io/browserext/#csp-overview">Content Security Policy (CSP)</a> for more information.</td></tr>                 
<tr><td><code>"options_page"</code></td><td>Optional</td><td>The page within the extension that allows extension users to modify settings or options for the extension.</td></tr>
<tr><td><code>"manifest_version"</code></td><td>Optional</td><td>This is not used</td></tr>
<tr><td><code>"required_keys":[...]</code></td><td>Optional</td><td>See the <a href="https://browserext.github.io/browserext/#required-keys"><code>required_keys</code> key</a> section for more information about this key.</td></tr>
<tr><td><code>"web_accessible_resources":[...]</code></td><td>Optional</td><td>Resources listed here may be accessed by Internet-hosted site pages.</td></tr>
<tr><td><code>"externally_connectable": [<br>
&nbsp;&nbsp;&nbsp;"ids": [...],<br>
&nbsp;&nbsp;&nbsp;"matches": [...],<br>
]</code></td><td>Optional</td><td>Other extensions or Internet-hosted site pages may send messages to this extension if their extension ID (<code>"ids"</code>) or page URL pattern (<code>"matches"</code>) are specified.</td></tr>
<tr><td><code>"permissions" : {<br>
&nbsp;&nbsp;&nbsp;"activeTab",<br>
&nbsp;&nbsp;&nbsp;"contextMenus",<br>
&nbsp;&nbsp;&nbsp;"tabs",<br>
&nbsp;&nbsp;&nbsp;"webNavigation",<br>
&nbsp;&nbsp;&nbsp;"webRequestBlocking",<br>
&nbsp;&nbsp;&nbsp;"&lt;url-pattern&gt;",<br>
}</code></td><td>Optional </td><td>Each subkey must be specified in order to use the associated API.<br>
<ul>
<li><code>activeTab...<a href="https://browserext.github.io/browserext/#tabs">browser.tabs</a></code> (<a href="https://browserext.github.io/browserext/#active-tab">activeTab</a>)</li>
<li><code>contextMenus...<a href="https://browserext.github.io/browserext/#contextMenus">browser.contextMenus</a></code></li>
<li><code>tabs...<a href="https://browserext.github.io/browserext/#tabs">browser.tabs</a></code></li>
<li><code>webNavigation...<a href="https://browserext.github.io/browserext/#webNavigation">browser.webNavigation</a></code></li>
<li><code>webRequest...<a href="https://browserext.github.io/browserext/#webRequest">browser.webRequest</a></code></li>
<li><code>webRequestBlocking...<a href="https://browserext.github.io/browserext/#webRequest">browser.webRequest </a></code>(blocking)</li>
</ul>

Patterns listed in <code>&lt;url-pattern&gt;</code> allow additional permissions for URLs that match those patterns. See <a href="https://browserext.github.io/browserext/#all-urls">Permissions URL patterns</a> for more information. 
                                                          </td></tr>
                 
            </tbody></table>
        </section>
        <section>
            <h3 id="all-urls">Permissions URL patterns</h3>
            <p> The <code>"permissions"</code> key may include match patterns that follow the structure <code>&lt;scheme&gt;://&lt;host&gt;/&lt;path&gt;</code>, such as <code>"*://*.w3.org/*"</code>. The special 
                pattern <code>"&lt;all_urls&gt;"</code> is also permitted. The match patterns identify a group of URLs for which the extension is requesting extra privileges:</p>
            <ul>
                <li>XHR access to those origins</li>
                <li>the ability to inject scripts with <code>tabs.executeScript</code> into pages from those origins</li>
                <li>the ability to receive events from the <code>webRequest</code> API for those origins</li>
            </ul>
        </section>
        <section>
            <h3 id="active-tab">The <code>activeTab</code> permission</h3>
            <p> The <code>"activeTab"</code> permission enables the use of <code>browser.tabs</code> API only if the user has actively initiated an action such as the <code>browserAction</code>. The <code>browser.tabs</code> API can be used until the tab is navigated to another page or closed.</p><p>Passive background-only extensions cannot use the <code>browser.tabs</code> API unless both the <code>"tabs"</code> permission and a URL pattern (e.g. <code>"&lt;all_urls&gt;"</code> or <code>"http://*"</code> or <code>"*://&amp;.w3.org/*"</code>) are explicitly declared in <code>manifest.json</code>. </p>        </section>
        <section>
            <h3 id="required-keys">The <code>required_keys</code> key</h3>
            <p>This key is optional, but if it is specified, it provides a list of strings representing manifest keys that MUST be supported. If the browser loading the extension does not support the specified key, the browser MUST reject the manifest and not load the extension.</p>
        </section>
                <section class="informative">
            <h3>Full Example</h3>
<pre>// Standards-compliant browsers are expected to ignore "//" comments. Disregarding comments, 
// the manifest.json file format for browser extensions is expected to be fully JSON compliant. 
// Malformed JSON files are not supported.
//
// Other manifest keys that are well-formed JSON but are not listed here MUST be ignored.
//
// Note that some fields marked as Optional here are required by vendor-specific distribution Stores.
{
  "name": "The Name of Your Extension",             // Required
  "version": "Your Extension Version",              // Required
  "default_locale": "en",                           // Required if locales are used. Otherwise, not allowed
  "description": "Description for Your Extension",   
  "icons": {...},                                    
  "developer": {                                    
       "name": "Your Name or Company",              
       "url": "Company Website"                      
  }
  // Note: Some browsers require an extension to use either browser_action or page_action, but not both simultaneously
  "browser_action": {  
      "default_icon": {...},                        // Same format as "icons"
      "default_popup": "Page URL",
      "default_title": "Title string"
  },
  "page_action": {...},                             // Same format as "browser_action"
  
  "browser_specific_settings": {                    
       "&lt;browser_name&gt;": {                          // Examples "gecko","opera","edge"
            "&lt;key&gt;": "&lt;value&gt;"                      // Examples "strict_min_version": "42.0", "id": "addon@example.com"
       }
  },
  "background": {                                   
      "page": "Page URL",                           // Only one of "page" or "scripts" is supported, but not both simultaneously
      "scripts": [],                                // Only one of "page" or "scripts" is supported, but not both simultaneously
      "persistent": false                           // Required if "background" is specified
  },
  "content_scripts": {                                                    
      "all_frames": false,                          
      "css": [],                                   
      "exclude_matches": [],                        
      "js": [],                                     
      "matches": [],                                
      "run_at" : "document_start"                   // Also "document_end", "document_idle"
  }
  "content_security_policy": "&lt;policy-string&gt;",     
  
  "options_page": "Page URL",                            // Optional
  "manifest_version": 2,                            // Not used
  "required_keys": [],                              // If a browser does not recognize a key in this list, it MUST 
                                                    // reject the manifest (e.g. "sidebar_action")
                                                    // FEEDBACK: Rename to "required_capabilities"
  "permissions": {                                  
       "activeTab",                                                
       "contextMenus",                              
       "tabs",                                      
       "webNavigation",                            
       "webRequest",                                
       "webRequestBlocking",                        
       "&lt;url-pattern&gt;"                              // Examples "http://*/*", "&lt;all_urls&gt;"
  },
  "web_accessible_resources": [...]    
  "externally_connectable" : [
       "ids":[...], // Identifiers for other extensions that are allowed to send messages
       "matches":[...] // URL patterns for hosted web pages allowed to send messages 
  ]                             
}
</pre>
        </section>
    </section>
    <section>
        <h2>Extension Resources</h2>
        <section>
            <h3>The <code>browserext://</code> protocol</h3>
            <p>
                To access resources within the extension, such as <code>browserext://&lt;ext_id&gt;/options.html</code>, the <code>browserext://</code> protocol is used.
            </p>
        </section>
        <section>
            <h3>Extension IDs</h3>
            <p>
                Each extension has an extension ID that follows the <code>browserext://</code> protocol. For example
            </p>
            <p class="example">
                <code>browserext://MyExtension_c1wakc4j0nefm/options.html</code>
                <code>browserext://dfcijpibodeoenkablikbkiobbdnkfki/options.html</code>
            </p>
            <p>
                The algorithms that generate these IDs are different for each browser. To access these resources, do not hardcode the ID generated by a particular browser. Instead, use the <code>runtime.getURL()</code> method to convert a relative file name or path to the absolute name or path, which includes the extension ID.
            </p>
        </section>
    </section>
    <section>
        <h2>Content Security Policy (CSP)</h2>
        <section>
            <h5 id="csp-overview">Overview</h5>
            <p>Content Security Policy (CSP) is intended to prevent inadvertant execution of malicious code. The default CSP for web content is discussed in the specification [[CSP3]] . For extensions, the default CSP is </p>
            <pre>"script-src 'self'; object-src 'self';"</pre>
            <p>This means:</p>
            <ul>
                <li>
                    <b>Only <code>&lt;script&gt;</code> and <code>&lt;object&gt;</code> resources that are included in the extension package may be accessed</b>
                    <p>If the extension must access additional script libraries such as jQuery, copies of the .js files must be included in the extension package. </p><p>Alternatively, an extension may loosen the restriction and allow a remote file to be accessed. In this case, the origin for the hosted .js file may be specified in the <code>"content_security_policy"</code> key in <code>manifest.json</code>. For example:
                    </p><p class="example"><code>"content_security_policy" : "script-src 'self' https://*.jquery.com; object-src 'self'"</code></p>
                </li>
                <li>
                    <b>The extension will not evaluate strings as JavaScript</b>
                    <p>The following are restricted by default:</p>
                    <ul>
                        <li><code>eval("script_goes_here;");</code></li>
                        <li><code>window.setTimeout("script_goes_here;", t);</code></li>
                        <li><code>var f = new Function("script_goes_here;");</code></li>
                    </ul>
                    <p>To enable the use of these evaluators, the CSP may be modified to include <code>'unsafe-eval'</code> as follows:</p>
                    <p class="example"><code>"content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self';"</code></p>
                </li>
                <li>
                    <b>Inline JavaScript is not executed</b>
                    <p>Inline <code>&lt;script&gt;</code> tags and inline event handlers (e.g. <code>&lt;div onclick="script_goes_here;"&gt;</code>) are silently ignored. To enable the use of inline script, a SHA256 hash of the entire tag may be added to the <code>"content_security_policy"</code> key in <code>manifest.json</code>. For example, replace <code>&lt;hash_goes_here&gt;</code> with the actual hash in the following:</p>
                    <p class="example"><code>"content_security_policy" : "script-src 'self' 'sha256-&lt;hash_goes_here&gt;'; object-src 'self'"</code></p>
                </li>
            </ul>
        </section>
        <section class="informative">
                <h5 id="csp-cross-domain">Cross-domain Privileges</h5>
                <p> Content scripts get the same cross-domain privileges as the rest of the extension. So if the extension has requested cross-domain access for a domain using the permissions key in <code>manifest.json</code>, then its content scripts get access that domain as well.</p>
            </section>
            <section class="informative">
                <h5 id="availability-csp-content">Content and Background Script Communication</h5>
                <p> Although content scripts can't directly use most of the extension APIs, they can communicate with the extension's background scripts using the messaging APIs, and can therefore indirectly access all the same APIs that the background scripts can.</p>
            </section>

        </section>
        <section>
            <h2 id="wd">Testing Extensions with WebDriver</h2>
            <p>
                Browsers vendors MAY choose to implement WebDriver support in their browsers to allow for the automated testing of browser extensions. To implement this support, the browser MUST support:
            </p>
            <ul>
                <li>The base functionality as defined in the WebDriver specification [[webdriver]] </li>
                <li>Additional functionality required to support browser extensions, defined below in the Browser Extensions specification</li>
            </ul>


            <section>
                <h3>Protocol</h3>
                <section>
                    <h4>List of Endpoints</h4>
                    <p>In addition to the endpoints defined in the WebDriver specification [[webdriver]], support for browser extensions requires these additional endpoints.</p>
                    <table class="simple">
                        <tbody>
                            <tr>
                                <th>Method</th>
                                <th>URI Template</th>
                                <th>Command</th>
                            </tr>
                            <tr>
                                <td>POST</td>
                                <td>/session/{<var>sessionId</var>}/browserext</td>
                                <td>Install Browser Extensions</td>
                            </tr>  
                            <tr>
                                <td>DELETE</td>
                                <td>/session/{<var>sessionId</var>}/browserext<var>extensionId</var>}</td>
                                <td>Uninstall a Browser Extension</td>
                            </tr>                                                      
                            <tr>
                                <td>GET</td>
                                <td>/session/{<var>sessionId</var>}/browserexts</td>
                                <td>Get Browser Extensions</td>
                            </tr>                            
                            <tr>
                                <td>GET</td>
                                <td>/session/{<var>sessionId</var>}/browserext/{<var>extensionId</var>}/actions</td>
                                <td>Get Browser Extension Actions</td>
                            </tr>
                            <tr>
                                <td>POST</td>
                                <td>/session/{<var>sessionId</var>}/browserext/{<var>extensionId</var>}/action/</td>
                                <td>Take Browser Extension Action</td>
                            </tr>
                            <tr>
                                <td>GET</td>
                                <td>/session/{<var>sessionId</var>}/element/{<var>element id</var>}/browserext/contextMenuItems</td>
                                <td>Get Browser Extension Context Menu Items</td>
                            </tr>
                            <tr>
                                <td>POST</td>
                                <td>/session/{<var>sessionId</var>}/element/{<var>element id</var>}/browserext/contextMenuItem/{<var>menuitemId</var>}</td>
                                <td>Select Browser Extension Context Menu Item</td>
                            </tr>
                            <tr>
                                <td>GET</td>
                                <td>/session/{<var>sessionId</var>}/browserext/permissionPrompt</td>
                                <td>Get Browser Extension Permission Prompt Text</td>
                            </tr>
                            <tr>
                                <td>POST</td>
                                <td>/session/{<var>sessionId</var>}/browserext/permissionPrompt/{<var>promptId</var>}/action/{<var>promptAction</var>}</td>
                                <td>Take Browser Extension Permission Prompt Action</td>
                            </tr>                        </tbody>
                    </table>
                </section>
                <section>
                    <h4>Handling Errors</h4>
                    <p>In addition to the codes defined in the Handling Errors section of the WebDriver specification [[webdriver]], support for browser extensions requires support the following additional error codes:</p>
                    <table class="simple">
                        <tbody>
                            <tr>
                                <th>
                                    Error Code
                                </th>
                                <th>
                                    HTTP Status
                                </th>
                                <th>
                                    JSON Error Code
                                </th>
                                <th>
                                    Description
                                </th>
                            </tr>
                            <tr>
                                <td><dfn id="dfn-no-such-extension-path" data-dfn-type="dfn">no such extension path</dfn></td>
                                <td>400</td>
                                <td><code>no such extension path</code></td>
                                <td>
                                    The filepath specified does not point to a valid browser extension on disk.
                                </td>
                            </tr>
                            <tr>
                                <td><dfn id="dfn-extension-not-installable" data-dfn-type="dfn">extension not installable</dfn></td>
                                <td>400</td>
                                <td><code>extension not installable</code></td>
                                <td>
                                    The specified extension could not be installed for some reason, e.g. its manifest.json is malformed or missing
                                </td>
                            </tr>                                                        
                            <tr>
                                <td><dfn id="dfn-no-such-browser-extension" data-dfn-type="dfn">no such browser extension</dfn></td>
                                <td>400</td>
                                <td><code>no such browser extension</code></td>
                                <td>
                                    There is no available browser extension on the current page with the given type.
                                </td>
                            </tr>
                            <tr>
                                <td><dfn id="dfn-no-such-browser-extension-action" data-dfn-type="dfn">no such browser extension action</dfn></td>
                                <td>400</td>
                                <td><code>no such browser action</code></td>
                                <td>
                                    A request to take a browser extension action could not be satisfied because
                                    there is no browser extension action with the given id.
                                </td>
                            </tr>
                            <tr>
                                <td><dfn id="dfn-no-such-browser-extension-context-menu-item" data-dfn-type="dfn">no such browser extension context menu item</dfn></td>
                                <td>400</td>
                                <td><code>no such browser extension context menu item</code></td>
                                <td>
                                    A request to select an extension context menu item could not be completed
                                    because there is no matching extension context menu item for the given
                                    element.
                                </td>
                            </tr>
                            <tr>
                                <td><dfn id="dfn-no-such-browser-extension-permission-prompt" data-dfn-type="dfn">no such browser extension permission prompt</dfn></td>
                                <td>400</td>
                                <td><code>no such browser extension permission prompt</code></td>
                                <td>
                                    A request to obtain the permission prompt information could not be completed
                                    because there is no permission prompt at this time or the requested prompt was not available.
                                </td>
                            </tr>
                            <tr>
                                <td><dfn id="dfn-no-such-browser-extension-permission-prompt-action" data-dfn-type="dfn">no such browser extension permission prompt action</dfn></td>
                                <td>400</td>
                                <td><code>no such browser extension permission prompt action</code></td>
                                <td>
                                    A request to take the specified action could not be completed
                                    because the action was not available.
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </section>
                </section>
                <section>
                    <h3>
                        Capabilities
                    </h3>
                    <p>In addition to the Capabilities defined in the WebDriver specification [[webdriver]], support for browser extensions requires the following additional entry on the <i>server capabilities</i> JSON object:</p>
                    <dl>
                        <dt>
                            "<code>enabledBrowserExtensions</code>"
                        </dt>
                        <dd>
                            An array of absolute paths which point to the location of browser extension files. The path <em title="MUST" class="rfc2119">MUST</em> point to either a single file appropriate for a specific brower (e.g. .crx) or a folder which contains the extension source files. If a folder is specified, the folder itself <em title="MUST" class="rfc2119">MUST</em> contain a <code>manifest.json</code> file. Subfolders containing <code>manifest.json</code> files will not be searched.
                        </dd>
                    </dl>

                    <section>
                        <h4>Extension Lifetime</h4>
                        <p>No browser extension will be installed or pre-loaded during a WebDriver session unless it is explicitly specified in the <code>enabledBrowserExtensions</code> array. Browser extensions loaded during the session will not be available to other active instances of the browser that are not part of the WebDriver session. When the session ends, the array of browser extensions are unloaded and uninstalled.</p>
                    </section>
                </section>
                <section>
                    <h3>
                        Browser Extensions Commands
                    </h3>
                    <p>Users interact with extensions through several means. First there are actions embedded in the UI of the browser, which can do something directly or open a popup. If the extension uses a popup, it can contain any html content. Finally, extensions can add items to the browser's context menu. WebDriver needs to be able to emulate user actions for all three of these controls in order to completely emulate user interaction.</p>
                    <p>In addition to the commands defined in the WebDriver specification [[webdriver]], support support for browser extensions requires the following additional commands. </p>
                    <section>
                        <h3><code>installBrowserExtensions()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>POST</td>
                                    <td id="get-browser-extensions">/session/{<var>sessionId</var>}/browserext</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command installs any number of specified extensions from disk at runtime
                        </p>
                        <aside class="example">
                            <div class="example-tite"></div>
                            <p>
                                To install an extension located at "/ext/" in a session with ID <i>0</i>, the local end would  
                                POST to <code>/session/0/browserext/</code> with the request body 
                            </p>
                            <pre class="hljs xquery">{ <span class="hljs-string">"extensionPaths"</span>: [<span class="hljs-string">"/ext/"</span>] }</pre>
                        </aside>                        
                        <p>

                            The value of the <code>extensionPaths</code> property MUST be an array of absolute paths which point to the location of browser extension files. The path <em title="MUST" class="rfc2119">MUST</em> point to either a single file appropriate for a specific brower (e.g. .crx) or a folder which contains the extension source files. If a folder is specified, the folder itself <em title="MUST" class="rfc2119">MUST</em> contain a <code>manifest.json</code> file. Subfolders containing <code>manifest.json</code> files will not be searched.
                        </p>
                        <p>
                            If any of the absolute paths specified in the <code>extensionPaths</code> property are invalid, a
                            <code><a href="https://browserext.github.io/browserext/#dfn-no-such-extension-path">no such extension path</a></code>
                            status code MUST be returned.
                        </p> 
                        <p>
                            If the installation of any extensions specified in the <code>extensionPaths</code> property fail, an
                            <code><a href="https://browserext.github.io/browserext/#dfn-extension-not-installable">extension not installable</a></code>
                            status code MUST be returned.
                        </p>                                                
                    </section> 
                    <section>
                        <h3><code>uninstallBrowserExtensions()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>DELETE</td>
                                    <td id="get-browser-extensions">/session/{<var>sessionId</var>}/browserext/{extensionId}</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command uninstalls an extension in a specified browsing session.
                        </p>

                        <dl class="parameters">
                            <dt>DOMString extensionId</dt>
                            <dd>
                                The unique identifier of the browser extension to be uninstalled from the session.
                            </dd>  
                            <p>
                                If the extensionId specified does not correspond to a browser extension in the current sesssion, a
                                <code><a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension">no such browser extension</a></code>
                                status code MUST be returned.
                            </p>
                        </dl>   
                    </section>                                       
                    <section>
                        <h3><code>getBrowserExtensions()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>GET</td>
                                    <td id="get-browser-extensions">/session/{<var>sessionId</var>}/browserexts</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command returns a list of all browser extensions available to the current browsing session.
                        </p><ul>
                            <li><p>Let <var>extension</var> be a new JSON Object.</p></li>

                            <li>
                                <p>
                                    Set the property <code>id</code> on <var>extension</var> to a
                                    string which is unique for each browser extension.
                                </p>
                            </li>
                                <li>
                                    <p>
                                        Set the property <code>name</code> on <var>extension</var> to a
                                        string which corresponds to the browser extension's <code>"name"</code> entry in <code>manifest.json</code>.
                                    </p>
                                </li>
                    </ul></section>                    
                    <section>
                        <h3><code>getBrowserExtActions()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>GET</td>
                                    <td id="get-browser-extension-actions">/session/{<var>sessionId</var>}/browserext/{<var>extensionId</var>}/actions</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command returns a list of browser extension actions
                            available for a particular browser extension. Note that this can change from page to page.
                            It MUST return a list of objects which describes the available browser extension
                            actions using the following algorithm for each action:

                        </p><ul>
                            <li><p>Let <var>action</var> be a new JSON Object.</p></li>

                            <li>
                                <p>
                                    Set the property <code>type</code> on <var>action</var> to a
                                    string which represents the type of browser extension action 
                                </p>
                            </li>

                            <li>
                                <p>
                                    Set the property <code>actionTitle</code> on <var>action</var> to the
                                    mouseover text for the action.
                                </p>
                            </li>

                            <li>
                                <p>
                                    Set the property <code>icon</code> on <var>action</var> to the
                                    filename of the icon file or an empty string if none is displayed. If the
                                    icon is dynamically generated, the current icon MUST be returned as a
                                    lossless PNG image encoded using Base64.
                                </p>
                            </li>

                            <li>
                                <p>
                                    If the action supports the <code>badgeText</code> property, 
                                    set the property <code>badgeText</code> on <var>action</var> to the
                                    badge text displayed over the action or an empty string if none is present.
                                </p>
                            </li>

                            <li>
                                <p>
                                    Return <code>success</code> with data <var>action</var>
                                </p>
                            </li>
                        </ul>
                        <dl class="parameters">
                            <dt>DOMString extensionId</dt>
                            <dd>
                                The unique identifier of the browser extension whose available actions are to be queried. 
                                Returned by the <code>getBrowserExtensions()</code> command.
                            </dd>
                            <p>
                                If the id specified does not correspond to a browser extension in the current sesssion, a
                                <code><a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension">no such browser extension</a></code>
                                status code MUST be returned.
                            </p>                            
                        </dl>                        
                        <p></p>
                    </section>
                    <section>
                        <h3><code>takeBrowserExtAction()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>POST</td>
                                    <td id="take-browser-extension-action">/session/{<var>sessionId</var>}/browserext/action/{<var>browserExtActionId</var>}</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command causes a browser extension action to be activated. Depending on the <code>extensionActionType</code> specified, this
                            will have one of several effects:
                        </p>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>extensionActionType</th>
                                    <th>Effect</th>
                                </tr>
                                <tr>
                                    <td>browserAction</td>
                                    <td>
                                        This <code>extensionActionType</code> causes a browserAction to be activated, 
                                        as if the user had clicked the browser extension's browserAction icon in the browser's chrome. 
                                        Depending on the browser extension, this may cause a popup to be opened. 
                                    </td>
                                </tr>
                                <tr>
                                    <td>pageAction</td>
                                    <td>
                                        This <code>extensionActionType</code> causes a pageAction to be activated, 
                                        as if the user had clicked the browser extension's pageAction icon in the browser's address bar. 
                                        Depending on the browser extension, this may cause a popup to be opened. 
                                    </td>
                                </tr> 
                                <tr>
                                    <td>enable</td>
                                    <td>
                                        This <code>extensionActionType</code> causes the specified extension to be enabled,
                                        as if the user had turned the extension on from the browser's management UI. If the extension
                                        is already enabled, this command has no effect. 
                                    </td>
                                </tr>  
                                <tr>
                                    <td>disable</td>
                                    <td>
                                        This <code>extensionActionType</code> causes the specified extension to be disabled,
                                        as if the user had turned the extension off from the browser's management UI. If the extension
                                        is already disabled, this command has no effect. 
                                    </td>
                                </tr>                                                                                             
                            </tbody>
                        </table>                        
                        <dl class="parameters">
                            <dt>DOMString browserExtId</dt>
                            <dd>
                                The unique identifier of the browser extension whose available actions are to be invoked. 
                                Returned by the <code>getBrowserExtensions()</code> command.
                            </dd>  
                            <p>
                                If the extensionId specified does not correspond to a browser extension in the current sesssion, a
                                <code><a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension">no such browser extension</a></code>
                                status code MUST be returned.
                            </p>                                                  
                            <dt>DOMString extensionActionType</dt>
                            <dd>
                                The type of the browser extension action to be taken, as returned
                                by the <code>getBrowserExtensionActions()</code> command. This value
                                <em class="rfc2119" title="SHOULD">SHOULD</em> be one of the following: "<code>pageAction</code>", 
                                "<code>browserAction</code>", "<code>enable</code>", or "<code>disable</code>"
                            </dd>
                        </dl>
                        <aside class="example">
                            <div class="example-tite"></div>
                            <p>
                                To click a pageAction of an extension with ID <i>1</i> in a session with ID <i>0</i>, the local end would  
                                POST to <code>/session/0/browserext/1/action/</code> with the request body 
                            </p>
                            <pre class="hljs xquery">{ <span class="hljs-string">"type"</span>: <span class="hljs-string">"pageAction"</span> }</pre>
                        </aside>                        
                        <p>
                            If the type specified does not correspond to a browser extension action available in the browser/on the current page, a
                            <code><a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension-action">no such browser extension action</a></code>
                            status code MUST be returned.
                        </p>
                    </section>
                    <section>
                        <!-- getExtensionContextMenuItems() -->
                        <h3><code>getBrowserExtContextMenuItems()</code></h3>

                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>GET</td>
                                    <td id="get-browser-extension-context-menu-items">/session/{<var>sessionId</var>}/element/{<var>elementId</var>}/browserext/contexMenuItems</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command opens a context menu for
                            a given element. It MUST return a list of objects which describes the
                            available context menu items using the following algorithm for each menu
                            item:

                        </p><ul>
                            <li><p>Let <var>menuitem</var> be a new JSON Object.</p></li>

                            <li>
                                <p>
                                    Set the property <code>id</code> on <var>menuitem</var> to a
                                    string which is unique for the current session.
                                </p>
                            </li>

                            <li>
                                <p>
                                    Set the property <code>menuItemTitle</code> on <var>menuitem</var> to the
                                    text that is displayed in the UI.
                                </p>
                            </li>

                            <li>
                                <p>
                                    Set the property <code>icon</code> on <var>menuitem</var> to the
                                    filename of the icon file or an empty string if none is displayed.

                                    If the icon is set because of the type of the context menu item (such as
                                    a radio button or checkbox), the <code>icon</code> property MUST be set
                                    to a string which is consistent for all icons of that type and status
                                    (e.g. checked), including across sessions.
                                </p>
                            </li>

                            <li>
                                <p>
                                    Set the property <code>parent</code> on <var>menuitem</var> to the
                                    id of the item's parent or an empty string if the menuitem does not have
                                    a parent.
                                </p>
                            </li>
                            <li>
                                <p>
                                    Set the property <code>itemType</code> on <var>menuitem</var> to a string value identifying the control type.
                                </p>
                                <table class="simple">
                                    <tbody>
                                        <tr>
                                            <th>
                                                String Value
                                            </th>
                                            <th>
                                                Description
                                            </th>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>checkbox</code>
                                            </td>
                                            <td>
                                                A checkbox element
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>normal</code>
                                            </td>
                                            <td>
                                                A standard menuItem element (text label)
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>radio</code>
                                            </td>
                                            <td>
                                                A radio element. Within a radio group, only one menuItem will have a value of <code>true</code>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>separator</code>
                                            </td>
                                            <td>
                                                A horizontal line separator, typically used between groups of related items such as radio groups
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </li>
                            <li>
                                <p>
                                    Set the property <code>itemChecked</code> on <var>menuitem</var> to a boolean value indicating
                                    state of the item according to the following table. This applies only to items of itemType <code>checkbox</code> or <code>radio</code>. Within a radio group, only one menuItem will have a value of <code>true</code>.
                                </p>
                                <table class="simple">
                                    <tbody>
                                        <tr>
                                            <th>
                                                Boolean Value
                                            </th>
                                            <th>
                                                Description
                                            </th>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>true</code>
                                            </td>
                                            <td>
                                                Selected
                                            </td>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>false</code>
                                            </td>
                                            <td>
                                                Not selected
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </li>
                            <li>
                                <p>
                                    Return <code>success</code> with data <var>menuitem</var>
                                </p>
                            </li>
                        </ul>

                        This list MUST contain all context menu items added by browser extensions and
                        MUST NOT contain any other context menu items.
                        <p></p>
                        <p>
                            After this command has been run, the context menu MUST remain open until the
                            next command that dismisses it (e.g. clicking, navigation) has been run.
                        </p>
                        <dl class="parameters">
                            <dt>WebElement elementId</dt>
                            <dd>
                                The id of the element for which the context menu should be opened.
                            </dd>
                        </dl>
                    </section>
                    <section>
                        <!-- selectExtensionContextMenuItem() -->
                        <h3><code>selectBrowserExtContextMenuItem()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>POST</td>
                                    <td id="get-browser-extension-context-menu-items">/session/{<var>sessionId</var>}/element/{<var>elementId</var>}/browserext/contextMenuItem/{<var>menuitemId</var>}</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            This command causes a context menu
                            item to be selected. This MUST have the same effect as a user clicking or
                            tapping the item in the open context menu.

                            If the menu item is a parent of other menu items, this command MAY open a
                            submenu, but MUST NOT have any other effect.
                        </p>
                        <p>
                            This command MUST be executed even if there is no context menu open.
                        </p>
                        <dl class="parameters">
                            <dt>String menuitemId</dt>
                            <dd>
                                The context menu item id, as returned by the
                                <code>getBrowserExtContextMenuItems()</code>
                                command.
                            </dd>
                        </dl>
                        <p>
                            If no context menu is currently open, a
                            <code><a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension-context-menu-item">no such extension context menu item</a></code>
                            status code MUST be returned.
                        </p>
                    </section>
                    <section>
                        <h3><code>getBrowserExtPermissionPrompt()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>GET</td>
                                    <td id="browser-ext-permission-prompt">/session/{<var>sessionId</var>}/browserext/permissionPrompt</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            Upon installation of a browser extension, a browser MAY notify the user of potential privacy-related capabilities of the extension. For example, if an extension's <code>manifest.json</code> requests the <code>"tabs"</code> or <code>"webNavigation"</code> permission, the browser MAY request user confirmation of these permissions. This command returns a JSON object that includes the names of permissions which require user confirmation and other information about the prompt. A similar prompt MAY also occur if an extension has been updated and the newer version requires additional permisisons. If there is no prompt at the time this API is called, the error "<a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension-permission-prompt">no such browser extension permission prompt</a>" is returned.
                        </p>
                        <ul><li>Let <var>permissionPrompt</var> be a new JSON Object.</li>
                            <li>Set the property <code>promptId</code> to a string which is unique for each time a prompt is displayed.</li>
                            <li>Set the property <code>promptMessageText</code> to a string which represents the text shown to the user, localized to the default locale specified in <code>manifest.json</code>.</li>
                            <li>Set the property <code>promptDefaultLocale</code> to the default locale code specified in <code>manifest.json</code>. If locales are not used by the extension, the property SHOULD be omitted, but MAY return an empty string ("").</li>
                            <li>Set the property <code>promptRequestingUrl</code> to a string representing the relevant URL. Strings returned here are the same strings defined in the <code>"permissions": [ ]</code> section of <code>manisfest.json</code>. If a URL is not applicable to the prompt, the property SHOULD be omitted but MAY also return an empty string ("").</li>
                            <li>Set the property <code>promptPermissions</code> to an array of strings which correspond to requested permissions. Strings returned here are the same strings defined in the <code>"permissions": [ ]</code> section of <code>manisfest.json</code>. If permissions are not applicable to the prompt, the property SHOULD be omitted, but MAY include an empty array ([]) or an array of empty strings ([""]). </li>
                            <li>Set the property <code>promptActions</code> to an array of strings which correspond to possible actions the user could take. The actions <code>allow</code> and <code>deny</code> are required. Other optional values MAY be returned, but the behavior is not prescribed in this specification.</li>
                        </ul>
                            <table class="simple">
                                    <tbody>
                                        <tr>
                                            <th>
                                                promptAction
                                            </th>
                                            <th>
                                                Required
                                            </th>
                                            <th>
                                                Description
                                            </th>
                                        </tr>
                                        <tr>
                                            <td>
                                                <code>allow</code>
                                            </td>
                                            <td>
                                                Required
                                            </td>
                                            <td>
                                                Allows the extension to use or access the capabilities or sites 
                                            </td>

                                        </tr>
                                        <tr>
                                            <td>
                                                <code>deny</code>
                                            </td>
                                            <td>
                                                Required
                                            </td>
                                            <td>
                                                Denies extension's use of the requested capabilities or sites. The browser implementation of <code>deny</code> is not prescribed in this specification, and MAY result in the cancellation of the extension's installation. 
                                            </td>

                                        </tr>
                                                                                <tr>
                                            <td>
                                                <code>dismiss</code>
                                            </td>
                                            <td>
                                                Optional
                                            </td>
                                            <td>
                                                Some browsers MAY provide the user with an option to close a prompt without taking an <code>accept</code> or <code>deny</code> action. The browser implementation of <code>dismiss</code> is not prescribed in this specification, and MAY result in the cancellation of the extension's installation. 
                                            </td>
                                        </tr>
                                                                                <tr>
                                            <td>
                                                <code><i>{custom}</i></code>
                                            </td>
                                            <td>
                                                Optional
                                            </td>
                                            <td>
                                                Some browsers MAY provide additional options not prescribed in this table. For example, <code>alwaysAllow</code>, <code>allowOnce</code> or <code>allowForThisSiteOnly</code> may be presented in a permission prompt. The browser implementation for these custom actions is not prescribed in this specification. 
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            <aside class="example">
                            <div class="example-permissionPrompt-unlocalized-noUrl"></div>
                                <p>This extension, which does not use locales, prompts to request broad permissions that do not correspond to a specific URL.</p>
                            <pre class="hljs xquery">{ 
<span class="hljs-string">"promptId"</span>: <span class="hljs-string">"1"</span>,
<span class="hljs-string">"promptMessageText"</span>: <span class="hljs-string">"A new extension Sample1 has been installed. It can access your browsing activity. Do you wish to continue? Yes No Close"</span>,
<span class="hljs-string">"promptPermissions"</span>: <span class="hljs-string">["tabs","webNavigation"]</span>,
<span class="hljs-string">"promptActions"</span>: <span class="hljs-string">["allow","deny","dismiss"]</span>
}</pre>
                        </aside> 
                                                    <aside class="example">
                            <div class="example-permissionPrompt-localized-with-url"></div>
                                <p>This extension, which uses locales to provide translated strings, prompts for permissions specific to a banking URL.</p>
                            <pre class="hljs xquery">{ 
<span class="hljs-string">"promptId"</span>: <span class="hljs-string">"2"</span>,
<span class="hljs-string">"promptMessageText"</span>: <span class="hljs-string">"A new extension RegionalBankAssistant1 has been installed. It can read and modify data on regionalbank1.com. Enable Cancel"</span>,
<span class="hljs-string">"promptDefaultLocale"</span>: <span class="hljs-string">"en"</span>,
<span class="hljs-string">"promptRequestingUrl"</span>: <span class="hljs-string">["http://*.regionalbank1.com"]</span>,
<span class="hljs-string">"promptActions"</span>: <span class="hljs-string">["allow","deny"]</span>
}</pre>
                        </aside> 
                    </section> 
                    <section>
                        <h3><code>takeBrowserExtPermissionPromptAction()</code></h3>
                        <table class="simple jsoncommand">
                            <tbody>
                                <tr>
                                    <th>HTTP Method</th>
                                    <th>Path Template</th>
                                    <th>Notes</th>
                                </tr>
                                <tr>
                                    <td>POST</td>
                                    <td id="browser-ext-permission-prompt-action">/session/{<var>sessionId</var>}/browserext/permissionPrompt/{<var>promptId</var>}/action/{<var>promptAction</var>}</td>
                                    <td></td>
                                </tr>
                            </tbody>
                        </table>
                        <p>
                            Performs the action specified by <code>promptAction</code>. If there is no prompt at the time this API is called, or if the requested <code>promptId</code> is not available, the error "<a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension-permission-prompt">no such browser extension permission prompt</a>" is returned. If the requested <code>promptAction</code> is not available, the error "<a href="https://browserext.github.io/browserext/#dfn-no-such-browser-extension-permission-prompt-action">no such browser extension permission prompt action</a>" is returned.
                        </p>
                    </section> 
                </section>
            </section>
        <section>
            <h2>Packaging</h2>
            <section class="informative">
                <h3>Overview</h3>
                <p>
                    Browser extensions MAY be distributed and subsequently loaded as individual files or via a container, such as a *.zip archive. Regardless of the packaging format, these containers MUST contain the following:
                </p>
                <ul>
                    <li>manifest.json</li>
                    <li>Necessary JavaScript files (&lt;filename&gt;.js)</li>
                </ul>
            </section>
            <section class="informative">
                <h3>Digital signatures</h3>
                <p>
                    Browser vendors MAY require that extension packages include a digital signature. The signature MAY indicate the source of the extension, such as a distribution store or the extension's publisher. This aspect of packaging varies by browser, and browser implementers MAY enforce different requirements.
                </p>
            </section>       
        </section>
        <section class="appendix">
            <h2 id="acknowledgements">Acknowledgements</h2>
            <p>
                Many thanks to the members of the <a href="https://www.w3.org/community/browserext/">Browser Extension Community Group</a> for their detailed feedback on this specification. Thanks to the members of the <a href="http://www.w3.org/testing/browser/">Browser Testing and Tools Working Group</a> for their recommendations and feedback on WebDriver support.
            </p>
            <p>Some sections are reproduced from MDN:</p>
            <ul>
                <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Internationalization</a></li>
                <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/i18n/Locale-Specific_Message_reference">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API/i18n/Locale-Specific_Message_reference</a></li>
                <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_scripts</a></li>
                <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_Security_Policy">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Content_Security_Policy</a></li>
                <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/content_security_policy">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/content_security_policy</a></li>
                <li><a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API">https://developer.mozilla.org/en-US/Add-ons/WebExtensions/API</a> for various parameter/property/member descriptions for relevant APIs herein</li>
            </ul>
        </section>
    <script>
        function updateResolved() {
            var e = document.getElementsByClassName("issue");
            var n = e.length;
            for (var i = 0; i < n; i++) {
                if (e[i].innerText.indexOf("[RESOLVED]") > 0) {
                    e[i].style.backgroundColor = "rgb(170,255,170)";
                }
                if (i <= 1) {
                    e[i].innerHTML += "<a href='#issue-1'>1</a> &nbsp; <a href='#issue-2'>2</a>  &nbsp; <a href='#issue-3'>3</a>  &nbsp;...&nbsp; <a href='#issue-" + (n) + "'>" + (n).toString() + "</a> ";
                }
                else if (i == (n-1)) {
                    e[i].innerHTML += "<a href='#issue-1'>1</a> &nbsp;...&nbsp; <a href='#issue-" + (i) + "'>" + (i).toString() + "</a> &nbsp;" + (i + 1).toString();
                } else {
                    e[i].innerHTML += "<a href='#issue-1'>1</a> &nbsp;...&nbsp; <a href='#issue-" + (i) + "'>" + (i).toString() + "</a> &nbsp;" + (i + 1).toString() + "&nbsp; <a href='#issue-" + (i + 2) + "'>" + (i + 2).toString() + "</a>  &nbsp;...&nbsp; <a href='#issue-" + (n) + "'>" + (n).toString() + "</a> ";
                }
            }
        }
        function updateCheckAnyPermissions() {
            var checkAnyPermissionsTokenPrefix = "CheckAnyPermissions_";
            var checkAnyPermissionsTokenPrefixReplaceWith = 'CheckAnyPermissions="';
            var checkAnyPermissionsTokenSuffix = "_";
            var e = document.body.getElementsByTagName("pre");
            var n = e.length;
            var q1 = -1;

            for (var i = 0; i < n; i++) {
                var s = e[i].innerHTML;
                if (s.indexOf(checkAnyPermissionsTokenPrefix) >= 0) {
                    q1 = s.indexOf(checkAnyPermissionsTokenPrefix) + checkAnyPermissionsTokenPrefix.length;
                    q2 = s.indexOf(checkAnyPermissionsTokenSuffix, q1);
                    s = s.substring(0, q2) + '"' + s.substring(q2 + 1, s.length);
                    e[i].innerHTML = s.replace(checkAnyPermissionsTokenPrefix, checkAnyPermissionsTokenPrefixReplaceWith);
                }
            }
        }

        // document.getElementsByClassName("issue-title marker")[0].childNodes[0].innerHTML = "<a href='https://github.com/browserext/browserext/issues/'>ISSUE 32</a>"
        function updateGithubIssues() {
            var githubIssueTokenPrefix = "##";
            var githubIssueTokenSuffix = "##";
            var e = document.body.getElementsByClassName("issue");
            var n = e.length;
            var q1 = -1;

            for (var i = 0; i < n; i++) {
                var s = e[i].innerHTML;
                if (s.indexOf(githubIssueTokenPrefix) >= 0) {
                    q1 = s.indexOf(githubIssueTokenPrefix) + githubIssueTokenPrefix.length;
                    q2 = s.indexOf(githubIssueTokenSuffix, q1);
                    s = s.substring(0, q2) + '">GitHub #' + s.substring(q1,q2) + "</a>" + s.substring(q2 + 2, s.length);
                    e[i].innerHTML = s.replace(githubIssueTokenPrefix, '<a href="https://github.com/browserext/browserext/issues/');

                }
            }
        }

        function checkRespecReady() {
            if (document.respecIsReady == null) {
                setTimeout("checkRespecReady()", 1000);
            }
            else {
                document.respecIsReady.then(function () {
                    updateResolved();
                    updateCheckAnyPermissions();
                    updateGithubIssues();
                });
            }
        }

        checkRespecReady();      
    </script>



</body></html>